Sunday, March 11, 2018

Android Execute Asyntask within another class from another class

I have a class inside which there is another class that extends AsyncTask. As,



public class Dashboard extends Activity {

-------------
--------------
--------------
public class getUnreadMessageCount extends AsyncTask {
protected JSONObject doInBackground(){
*********some database stuff************
}
protected void onPostExecute(JSONObject json) {
count = Integer.parseInt(json.getString("messsage_count"));
// Set Text to the textview

messageCount.setText(count);
}

}
}


Now I am using GCMIntentService Class for notification. How can I call and execute the getUnreadMessageCount in the following



private void sendNotification(String content_id, int type, String msg) {


}


I tried as



private void sendNotification(String content_id, int type, String msg) {
Dashboard dashboard = new Dashboard;
dashboard.Dashboard dashboard----
}



But it does not work. How could I solve this problem.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...