I have a Thread that downloads data from internet
public class Bp implements Runnable
{
Handler myHandler;
public void setHandler(Handler myHandler)
{ this.myHandler=myHandler; }
....
myHandler.sendEmptyMessage (0);
}
There is an activity that needs to be updated according to downloaded data.
public class Hp extends Activity implements Runnable
{
....
public Handler myHandler = new Handler() {
public void handleMessage(Message msg) {
//TODO handle myHandler from "Bp" Thread
//TODO remove Queue's View
if(m_adapter2.getCount ()==6)
{
m_adapter2.remove (queue); //removing view named queue from adapter
m_adapter2.notifyDataSetChanged ();
}
}
};
Whenever I run above code I get NullPointer Exception .Please help me to update the view.