バックグラウンドでのxml解析としてバックグラウンド操作を行うために非同期タスクを使用していますが、うまく機能しますが、Androidデバイスの起源を変更すると、強制終了が発生します.Googleはそれに応じて何もしないか、言うことができます私の自己を探求することができません.誰かが私にこの共有についてアイデアを持っています..私はあなたに感謝します..
@Override
protected void **onPreExecute()** {
if(refreshFlage)
{
Log.i("refreshFlage","refreshFlage");
dialog = new ProgressDialog(ReplyForm.replyform);
dialog.setMessage("Processing...");
dialog.setIndeterminate(true);
dialog.setCancelable(false);
dialog.show();
}
else
{
dialog = new ProgressDialog(QuestionScreen.questionscreen);
dialog.setMessage("Processing...");
dialog.setIndeterminate(true);
dialog.setCancelable(false);
dialog.show();
}
}
@Override
protected void **onPostExecute**(final Boolean success) {
dialog.cancel();
try {
java.lang.System.gc();
} catch (Exception e) {
e.printStackTrace();
}
}else {
try{
}
}
catch (NullPointerException e) {
// TODO: handle exception
}
}
}
@Override
protected Boolean **doInBackground**(final String... args) {
getQuestionsMethod();
return null;
}
private void getQuestionsMethod() {
// TODO Auto-generated method stub
HttpResponse response = null;
InputStream is = null;
JSONObject jsonObj = new JSONObject(result);
JSONObject jobj = jsonObj.getJSONObject("question");
group_subject = jobj.getString(TAG_SUBJECT);
question_id = jobj.getString(TAG_QUESTIONID);
author_name = jobj.getString(TAG_AUTHORNAME);
lastpost_date = jobj.getString(TAG_LASTPOSTDATE);
replies = jobj.getString(TAG_REPLIES);
newPost = jobj.getString(TAG_NEWPOST);
userCanReply = jobj.getString(TAG_USERCANREPLY);
poll = jobj.getString(TAG_POLL);
HashMap<String, Object> groupdetailData = new HashMap<String, Object>();
groupdetailData.put(TAG_SUBJECT, group_subject);
groupdetailData.put(TAG_QUESTIONID, question_id);
groupdetailData.put(TAG_AUTHORNAME, author_name);
groupdetailData.put(TAG_LASTPOSTDATE, lastpost_date);
groupdetailData.put(TAG_REPLIES, replies);
groupdetailData.put(TAG_POLL, poll);
groupdetailData.put(TAG_NEWPOST, newPost);
groupdetailData.put(TAG_USERCANREPLY, userCanReply);
int arrayCount = questiondetailarraylist.size();
if (arrayCount > 0) {
questiondetailarraylist.clear();
}
if (poll.equalsIgnoreCase("true")) {
pollmulti = jobj.getString(TAG_POLLMULTI);
pollsubject = jobj.getString(TAG_POLLSUBJECT);
Pollid = jobj.getString(TAG_POLLID);
groupdetailData.put(TAG_POLLMULTI, pollmulti);
groupdetailData.put(TAG_POLLSUBJECT, pollsubject);
groupdetailData.put(TAG_POLLID, Pollid);
//mDbHelper.insertPollfield(questionid, pollmulti, pollsubject, Pollid);
groupdetailData.put("PollTrueData", pollTrueVector);
//System.out.println("after poll method..");
}
//System.out.println(groupdetailData.size());
questiondetailarraylist.add(groupdetailData);
//System.out.println("11111111111111111");
} catch (Exception e) {
Log.e("log_tag", "Error converting result " + e.toString());
}
}
answersHashMap.put("vectorArray", vectorArray);
answersHashMap.put("lastUpdateValue", lastUpdateValue);
} catch (Exception e) {
Log.e("log_tag", "Error converting result " + e.toString());
}
}