I need to run the following when i get a message from my GCM listner:
public void GetInfo1 (Bundle data){
Log.d("Get Messages", "Data: " + String.valueOf(data));
final String uid = data.getString("uid");
final String infoid = data.getString("infoid");
GetInfo(uid, infoid); // This is another activity that does a Json Post and returns a array that i use to populate my Listview
}
This is how i call the function :
if (activityName.equals(MyActivity.class.getName())) {
// Execute that special method from ActivityListView
Log.d(TAG, "Activity is running");
MyActivity myActivity = new MyActivity();
myActivity.Getinfo1(data);
} else {
// Show the notification
sendNotification(message);
}
but i am always getting this error :
Can't create handler inside thread that has not called Looper.prepare()
I have tried everything, and am out of ideas now,
I need to call the function and pass the vars but if i make it static i get a error that you cant call non static methods from a static ....
Please any help will be fantastic
T-