Calling a method from another class in TextToSpeech API
<p>I am using the TextToSpeech API and I want to seperate some logic into another class. </p>

<p>In the separate class I have put the following method: </p>

<pre><code>public static void sayHello() {
// Select a random hello.
int helloLength = SoundGameScore.Questions.length;
String hello = SoundGameScore.Questions[currentHelloIndex];
currentHelloIndex = (currentHelloIndex + 1) % helloLength;
mTts.speak(hello, TextToSpeech.QUEUE_FLUSH, // Drop all pending entries
                                            // in the playback queue.
        null);
</code></pre>

<p>I have then created a variable in the main class: <code>static mainclass object;</code></p>

<p>Within a button in the main class I call the method through this object by using: </p>

<pre><code>object.sayHello();
</code></pre>

<p>I am quite new to android, and I know I am doing something wrong as this gives me a process closed error in the emulator. This also shows a nullexception error in logcat. Please help me, thanks. </p>
