i am a new android Developer,
i wrote one thread class,and i call the thread class when i click a button from another class but throw null pointer exception ,the class call define public this is my code,
Class A;
done.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
ClassB b=new ClassB();
b.runalarm();
}
Class B;
public void runalarm()
{
SimpleThread my=new SimpleThread("myclass");
my.start();
}
class SimpleThread extends Thread
{
private static final int None = 0;
public SimpleThread(String str)
{
super(str);
}
public void run()
{
try
{
boolean loop=true;
DatabaseHelper1 dbHelper1=new DatabaseHelper1(getApplicationContext());
}
please solve my problem in advance
Try doing something like this…