-1

Okay so here is what i am trying to do.....

        new AsyncTask<Void, Integer, Void>(){

            @Override
        protected Void doInBackground(Void... arg0) {
            try {                 
             Thread.sleep(1000);             
            } catch (InterruptedException e) {                         
                e.printStackTrace();             
                    }            
                    return null;
            }
            @Override         
        protected void onPostExecute(Void result) {             
                    text1.setText("Nice to meet you "+name);
                    dismissDialog(typeBar);
                     }


                @Override        
        protected void onPreExecute() { 
            typeBar = 0;
        showDialog(typeBar);

        }

        }.execute((Void)null);

        }
    });
    }

The problem is in my app the textView changes ALOT!. Every time the button is clicked..I dont want to right an AsyncTask each time the textView changes. That will be to tedious and use to much resouce. Does anyone is it a better way i can implement this?

tj walker
  • 1,333
  • 3
  • 15
  • 18

1 Answers1

0

This is kind of similar to one of my previous post answers (same idea):

How to save Alarm after app killing?

Community
  • 1
  • 1
JoxTraex
  • 13,423
  • 6
  • 32
  • 45