i have activity take long time until get loading so i want when i click start this activity to show loading message like ( loading..... )
here is the button that started this activity
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(test.this, MainActivity.class);
startActivity(intent);
}
});
so what the code that should i write here to show this loading message until the MainActivity load?
If you have activity A that on click shows activity B that takes long time to load, the most common way is this:
in the activity B layout view have a progress bar and make it visible in onCreate of activity B
all long running operations put either in a asyncTask or in some Service that would run in the background
when long running operation finishes - update progress bar by setting it's visibility to View.GONE.
I would write you a code, but since I don't have your code, I think the best way I could help is to break your problem into a steps.