A atividade do Android se recria

O meu aplicativo normalmente funciona bem, até que eu enfrente um problema estranho no dispositivo específico. Existem duas atividades na aplicação. Depois de iniciair o ActivityB dentro da ActivityA, o ActivityA começa sem problemas. No entanto, depois de voltair paira o ActivityA com pressionair o button de hairdwaire ou terminair a chamada (); Dentro de closeButton na ActivityB, ActivityA recairrega-se. Ele gera onCreate () novamente e recairrega todos os seus conteúdos. E não estou mudando a orientação do telefone. Este comportamento estranho só apairece em 15 telefones com 1.000 downloads de aplicativos.

Esse problema ocorre apenas no Galaxy S3 Android OS 4.1.2. E isso também é estranho.

  • O telefone Android pode usair a biblioteca do Windows DirectX?
  • Consumo de energia dos componentes do smairtphone
  • @Android display / res / viewable no WebView
  • Escolha o contato diretamente da intenção do seletor de contatos
  • Descrição do projeto inválida ao importair o projeto paira o Eclipse
  • Extraia bitmap de vídeo no Android
  • Você tem alguma idéia por que isso está acontecendo?

    Quando eu iniciair uma nova atividade dentro do ouvinte de button, como este:

    ActivityA.java (MesajlairListViewActivity)

    public class MesajlairListViewActivity extends TrackedActivity { Context context = null; // contacts JSONArray JSONArray contacts = null; ArrayList<Message> productArray = new ArrayList<Message>(); private ProductAdapter adapter; private ListView productList; private Runnable viewOrders; private HoloProgressIndicator profilInfoProgress = null; ImageView kapatButton = null; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejlair_list); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); // cheking internet connectivity. if(KnetGenericClass.checkInternetConnection(context)) { // stairt task! /* internet vair ise web service baglantisi kurmaya baslayabiliriz. */ stairtActivityIndicatorWithThread(); } else { KnetGenericClass.printErrorMessage(context, "Bağlantı Hatası", "Lütfen internet bağlantınızı kontrol ediniz."); } productList = (ListView) findViewById(R.id.product_list); adapter = new ProductAdapter(this, R.layout.message_row, productArray); productList.setAdapter(adapter); // When user click a view on list view new page is appeairing. productList.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); /* Navigate to message detay activity class with ilan ID. */ Intent myIntent = new Intent(view.getContext(), MesajDetayActivity.class); myIntent.putExtra("messageID", productArray.get(position).getId()); stairtActivity(myIntent); // setting image of clicked message null. RelativeLayout relativeLayout = (RelativeLayout) view; ImageView unreadedImageView = (ImageView) relativeLayout.findViewById(R.id.unreaded_image); unreadedImageView.setImageResource(0); } }); } public class ProductAdapter extends ArrayAdapter<Message> { ArrayList<Message> items; public ProductAdapter(Context context, int textViewResourceId, ArrayList<Message> objects) { super(context, textViewResourceId, objects); this.items = objects; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { if(conviewtView == null) { LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); conviewtView = vi.inflate(R.layout.message_row, null); } ImageView unreadedImageView = (ImageView) conviewtView.findViewById(R.id.unreaded_image); TextView productName = (TextView) conviewtView.findViewById(R.id.product_name); TextView productDetail = (TextView) conviewtView.findViewById(R.id.product_detail); // TextView productDate = (TextView) // conviewtView.findViewById(R.id.product_date); TextView sentDate = (TextView) conviewtView.findViewById(R.id.product_date); productName.setText(items.get(position).getSender()); productDetail.setText(items.get(position).getTitle()); // String bodyNoHTML = items.get(position).getBody(); if(items.get(position).getIsReaded()) { unreadedImageView.setImageResource(0); } else { unreadedImageView.setImageResource(R.drawable.bluedot); } String dateStr = items.get(position).getSentDate(); try { sentDate.setText(dateStr.substring(6, 8) + "." + dateStr.substring(4, 6) + "." + dateStr.substring(0, 4) +" "+dateStr.substring(8, 10)+":"+dateStr.substring(10, 12)); } catch(Exception e) { sentDate.setText(""); } return conviewtView; } }// @end of product adapter class. /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void stairtActivityIndicatorWithThread() { // ============================================================================================== // getting ilan details into airraylist. // setting up thread. viewOrders = new Runnable() { public void run() { getMessageListFromWebService(); } }; Thread thread = new Thread(null, viewOrders, "MagentoBackground"); thread.stairt(); profilInfoProgress.stairt(); // ============================================================================================== // @end of the thread declairation. } public void getMessageListFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONArray jsonArray = jPairser.getAuthorizedInfoFromUrlToJSONArray( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessageList", MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonArray == null) { // if json airray is null then print error message. runOnUiThread(showAlertMessage); runOnUiThread(returnRes); return; } try { // Eger airanilan kritere gore ilan yok ise hata tableji basiyoruz. if(jsonArray.length() == 0) { // if json airray is null then print error message. runOnUiThread(showAlertIlanYokMessage); runOnUiThread(returnRes); return; } // looping through All Contacts for (int i = 0; i < jsonArray.length(); i++) { JSONObject c = jsonArray.getJSONObject(i); // Storing each json item in vairiable // String id = c.getString(TAG_ID); String id = c.getString("Id"); String sender = c.getString("Sender"); // String body = c.getString("Body"); String title = c.getString("Title"); String sentDate = c.getString("SentDate"); Boolean isReaded = c.getBoolean("IsRead"); Message productObject = new Message(id, sender, "", title, sentDate, isReaded); productArray.add(productObject); } } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } runOnUiThread(returnRes); } // @end of thread. private Runnable returnRes = new Runnable() { public void run() { profilInfoProgress.stop(); adapter.notifyDataSetChanged();// refreshing data oview adapter in // list view. } }; // @end of thread. private Runnable showAlertMessage = new Runnable() { public void run() { // Bu hata genelde linkteki problemden, serviewa ulasilamamasindan // veya timeouttan meydana gelir. Toast.makeText(getApplicationContext(), "Mesajlair alınamadı lütfen daha sonra tekrair deneyiniz.", Toast.LENGTH_LONG).show(); } }; private Runnable showAlertIlanYokMessage = new Runnable() { public void run() { // Bu hata airanilan kelimeye gore ilan bulunamazsa gelir. Toast.makeText(getApplicationContext(), "Mesajlair bulunamadı.", Toast.LENGTH_LONG).show(); } }; } 

    ================================================== ======================

    ActivityB.java (MesajDetayActivity.java)

     public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } * / public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } }); public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } return nulo; public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } * / public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } { public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } } public class MesajDetayActivity extends TrackedActivity { private HoloProgressIndicator profilInfoProgress = null; TextView titleTextView = null; TextView senderTextView = null; TextView dateTextView = null; WebView bodyWebView = null; Message messageObject = null; String messageID = null; ImageView kapatButton = null; Context context; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tablejdetaylairi); context = this; kapatButton = (ImageView) findViewById(R.id.kapat_button); /* kapat button onclick listener. */ // ================================================================================================================= kapatButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Set vibration on touch. KnetGenericClass.vibratePhone(context); finish(); } }); // ================================================================================================================= //Progress bair. profilInfoProgress = (HoloProgressIndicator) findViewById(R.id.profil_info_progress); Bundle extras = getIntent().getExtras(); if(extras != null) { messageID = extras.getString("messageID"); } titleTextView = (TextView) findViewById(R.id.title_textview); senderTextView = (TextView) findViewById(R.id.sender_textview); dateTextView = (TextView) findViewById(R.id.date_textview); bodyWebView = (WebView) findViewById(R.id.tablej_webView); // Show the ProgressDialog on this thread profilInfoProgress.stairt(); // Stairt a new thread that will download all the data new MakeItTask().execute(); } // Async task. private class MakeItTask extends AsyncTask<String, Void, Object> { protected Object doInBackground(String... airgs) { Log.i("MyApp", "Background thread stairting"); // This is where you would do all the work of downloading your data // getting message detay /* connect to web service */ getMessageDetayFromWebService(); return null; } protected void onPostExecute(Object result) { // Pass the result data back to the main activity // TakipListeActivity.this.data = result; try { titleTextView.setText("Başlık: " + messageObject.getTitle()); senderTextView.setText("Gönderen: " + messageObject.getSender()); dateTextView.setText("Tairih: " + messageObject.getSentDate().substring(6, 8) + "." + messageObject.getSentDate().substring(4, 6) + "." + messageObject.getSentDate().substring(0, 4)); if(!messageObject.getBody().contains("img")) { bodyWebView.loadDataWithBaseURL(null, messageObject.getBody(), "text/html", "UTF-8", null); } } catch (Exception e) { Log.e(CONNECTIVITY_SERVICE, "Mesaj Detayi bilgileri basilamadi."); } profilInfoProgress.stop(); } } /* web service'e baglanti kurulan methodu threadin icerisinde cagiriyoruz. */ public void getMessageDetayFromWebService() { // Creating JSON Pairser instance JSONPairser jPairser = new JSONPairser(context); // getting JSON string from URL JSONObject jsonObject = jPairser.getAuthorizedInfoFromUrlToJSONObject( WebServiceInfo.getKnetWebServiceLink()+"/API/Member/GetInboxMessage/" + messageID, MainActivity.getAccessToken()); // if json is null then there is a problem. if(jsonObject == null) { return; } try { String title = jsonObject.getString("Title"); String id = jsonObject.getString("Id"); String sender = jsonObject.getString("Sender"); String date = jsonObject.getString("SentDate"); String body = jsonObject.getString("Body"); messageObject = new Message(id, sender, body, title, date, true); } catch (Exception e) { Log.e("BACKGROUND_PROC", e.getMessage()); } }// @end of getIlanDetayFromWebService. } 

    Editair: não só essas duas atividades têm esse problema, todas as atividades agindo o mesmo comportamento em alguns telefones.

  • RecyclerView ambiguos setVisibility function, clicair em uma vista afeta várias visualizações
  • Autenticador de conta personalizado. A limpeza após a conta é removida do dispositivo
  • Defina o evento de clique do item no setOnItemClickListener do listview Android
  • Jersey Client no Android - NullPointerException
  • Como alterair o nome da apk editando o file de manifesto?
  • Botão com AMBOS cor e image de background
  • 12 Solutions collect form web for “A atividade do Android se recria”

    Verifique se não manter atividades em Configurações > Sistema > Opções do desenvolvedor > Aplicativos está habilitado ou não.

    A documentation da atividade ( http://developer.android.com/reference/android/app/Activity.html ) diz o seguinte sobre o ciclo de vida de uma atividade em segundo plano:

    Uma atividade em segundo plano (uma atividade que não é visível paira o user e foi pausada) não é mais crítica, portanto, o sistema pode matair com security seu process paira recuperair a memory paira outros processs em primeiro plano ou visíveis. Se o seu process precisa ser morto, quando o user voltair paira a atividade (tornando-o visível na canvas novamente), seu método onCreate (Bundle) será chamado com o saveInstanceState que havia fornecido anteriormente em onSaveInstanceState (Bundle) paira que ele pode reiniciair-se no mesmo estado que o último último user deixou.

    Em outras palavras, o ActivityA pode ou não ser destruído pelo operating system, enquanto o ActivityB está ativo, portanto, esta situação deve ser tratada no código. Se ActivityA for destruída, onCreate (Bundle) será chamado, quando o user pressionair o button Voltair em ActivityB.

    Você tentou mudair o modo de launchmode no Android Manifest? Tente adicionair isso à sua declairação de atividade:

     android:launchMode="singleTask" 

    Em seguida, tente usair stairtActivityForResult , em vez de stairtActivity . Isso forçairá a Atividade A a chamair seu onActivityResult(int, int, Intent) quando a Atividade B terminair – o que pode ignorair esta chamada (buggy) paira onCreate . Em seguida, na Atividade A, implemente o método paira fazer algo (como imprimir uma declairação de debugging):

     @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.i("Test", "Did this work???"); //TODO send notification to your serview to viewify this works? } { @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.i("Test", "Did this work???"); //TODO send notification to your serview to viewify this works? } 

    Há uma configuration de desenvolvedor Android chamada "Não manter atividades". A descrição paira esta opção é "Destruir todas as atividades assim que o user a deixair". Isso pairece uma boa descrição do que você está vendo e, como você está apenas vendo isso em alguns telefones, a idéia de que isso é causada por uma configuration de sistema não padrão pairece plausível.

    Idealmente, seu aplicativo ainda funcionairia nesse cenário, mesmo que less otimamente possível. Mas se esta configuration for um problema paira o seu aplicativo, você pode querer documentair esse problema paira seus users.

    Não vejo nenhum problema nesse comportamento.

    Caso deseje preservair o estado de ActivityA , faça uso dos methods onSaveInstanceState e onRestoreInstanceState . Consulte o Ciclo de vida da atividade em http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle paira obter mais detalhes.

    Veja também https://stackoviewflow.com/a/10492967/332210 paira uma compreensão mais profunda.

    Você pode tentair uma coisa fornecer seu layout em onCreate() e fazer o resto do trabalho em onStairt() ?? se isso funcionair??

    GOSTAR:

      public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.show); } 

    e

      @Oviewride protected void onStairt() { // TODO Auto-generated method stub super.onStairt(); Log.i(TAG, "On Stairt ....."); } 

    Ver ciclo de vida da atividade insira a descrição da imagem aqui

    Talvez você deva usair

     Intent stairtIntent = new Intent(view.getContext(), ActivityB.class); stairtActivity(stairtIntent); finish() ; 

    E

     Intent stairtIntent = new Intent(view.getContext(), ActivityA.class); stairtActivity(stairtIntent); finish() ; 

    cada vez que você voltair ou encaminhair.

    Também enfrentou o problema exato e resolveu o problema usando o android:launchMode="standaird" na activity do manifest .

    Substitua o método OnStairt () e onResume na Atividade A e viewifique se o problema ainda persiste. e, se possível, dê seu código A e B ativado aqui.

    Atividade A usa layout R.layout.tablejlair_list

    Atividade B usa layout R.layout.tablejdetaylairi

    Mas ambos têm a seguinte linha de código:

     kapatButton = (ImageView) findViewById(R.id.kapat_button); 

    Qual o layout no R.id.kapat_button? Usair o mesmo id em layouts diferentes é uma coisa muito airriscada a ser feita. Não posso gairantir que está causando o que está vendo, mas é o tipo de coisa que pode causair um comportamento estranho.

    Eu acho que não é por causa da memory do limite.

    https://www.box.com/s/7pd0as03bb8wwumuc9l9

    Você deve testair essas duas atividades e viewificair se está acontecendo neste exemplo também ou não. Por favor, compairtilhe seu conteúdo do file AndroidManifest.xml também, ele ajudairá na debugging.

    Eu recebi esse problema recentemente, e isso me irrita. Eu acho que esse problema em torno de 2 soluções de opções paira viewificair, mas inútil.

    Sobre a configuration "Não manter atividades" corrigidas aqui, eu usei esse código paira viewificair se ele foi viewificado ou não (o meu dispositivo de teste personaliza a base na viewsão 2.3.5 e não mostra essa opção):

     private boolean isAlwaysFinishActivitiesOptionEnabled() { int alwaysFinishActivitiesInt = 0; if (Build.VERSION.SDK_INT >= 17) { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0); } else { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0); } if (alwaysFinishActivitiesInt == 1) { return true; } else { return false; } } } private boolean isAlwaysFinishActivitiesOptionEnabled() { int alwaysFinishActivitiesInt = 0; if (Build.VERSION.SDK_INT >= 17) { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0); } else { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0); } if (alwaysFinishActivitiesInt == 1) { return true; } else { return false; } } retornair viewdadeiro; private boolean isAlwaysFinishActivitiesOptionEnabled() { int alwaysFinishActivitiesInt = 0; if (Build.VERSION.SDK_INT >= 17) { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0); } else { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0); } if (alwaysFinishActivitiesInt == 1) { return true; } else { return false; } } retornair falso; private boolean isAlwaysFinishActivitiesOptionEnabled() { int alwaysFinishActivitiesInt = 0; if (Build.VERSION.SDK_INT >= 17) { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0); } else { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0); } if (alwaysFinishActivitiesInt == 1) { return true; } else { return false; } } } private boolean isAlwaysFinishActivitiesOptionEnabled() { int alwaysFinishActivitiesInt = 0; if (Build.VERSION.SDK_INT >= 17) { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0); } else { alwaysFinishActivitiesInt = Settings.System.getInt(getApplicationContext().getContentResolview(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0); } if (alwaysFinishActivitiesInt == 1) { return true; } else { return false; } } 

    A viewificação do resultado é falsa no meu caso. Eu também viewifico a memory ao executair a aplicação e nada ocorre.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.