Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. class getDescContent extends AsyncTask<Void, Void, Void> {
  2. FileInputStream input = null;
  3. String episode = null;
  4. String descript = null;
  5.  
  6. @Override
  7. protected Void doInBackground(Void... arg0) {
  8. try {
  9. input = new FileInputStream(descFile);
  10. BufferedReader br = new BufferedReader(new InputStreamReader(input));
  11. String line;
  12. while ((line = br.readLine()) != null) {
  13. if (line.length() < 50) {
  14. episode = line;
  15. continue;
  16. }
  17. descript = line;
  18. Log.i("", descript);
  19. }
  20. input.close();
  21. br.close();
  22. } catch (FileNotFoundException e) {
  23. // TODO Auto-generated catch block
  24. e.printStackTrace();
  25. } catch (IOException e) {
  26. // TODO Auto-generated catch block
  27. e.printStackTrace();
  28. }
  29. return null;
  30. }
  31. @Override
  32. protected void onPostExecute(Void v) {
  33. final Dialog dialog = new Dialog(context);
  34. dialog.setContentView(R.layout.info_dialog);
  35. dialog.setTitle(episode);
  36. TextView descrip = (TextView) findViewById(R.id.dialog_text);
  37. descrip.setText(descript);
  38. dialog.show();
  39. }
  40. }
  41.  
  42. final Dialog dialog = new Dialog(context);
  43. dialog.setContentView(R.layout.info_dialog);
  44. dialog.setTitle(episode);
  45. TextView descrip = (TextView) dialog.findViewById(R.id.dialog_text); //change in this line
  46. descrip.setText(descript);
  47. dialog.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement