Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class getDescContent extends AsyncTask<Void, Void, Void> {
- FileInputStream input = null;
- String episode = null;
- String descript = null;
- @Override
- protected Void doInBackground(Void... arg0) {
- try {
- input = new FileInputStream(descFile);
- BufferedReader br = new BufferedReader(new InputStreamReader(input));
- String line;
- while ((line = br.readLine()) != null) {
- if (line.length() < 50) {
- episode = line;
- continue;
- }
- descript = line;
- Log.i("", descript);
- }
- input.close();
- br.close();
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- @Override
- protected void onPostExecute(Void v) {
- final Dialog dialog = new Dialog(context);
- dialog.setContentView(R.layout.info_dialog);
- dialog.setTitle(episode);
- TextView descrip = (TextView) findViewById(R.id.dialog_text);
- descrip.setText(descript);
- dialog.show();
- }
- }
- final Dialog dialog = new Dialog(context);
- dialog.setContentView(R.layout.info_dialog);
- dialog.setTitle(episode);
- TextView descrip = (TextView) dialog.findViewById(R.id.dialog_text); //change in this line
- descrip.setText(descript);
- dialog.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement