I'm noob and later read so much and do tests on my app, I have some
questions. I hope that somebody can help me.
I will put yourselves on context: I've an app with a tabLayout structure,
with 5 tabs (one activity for each tab). In the first tab i've a very
simple RSS activity, in other a static info and a button call to google
maps activity, other an image with a custom touchlistener to drag&drop and
make zoom etc..
As I've been reading when I start my app on a MainActivity and I create my
tabHost, he create the 5 Activities. But it takes too long in my view.
Then:
1.*How to Load efficiently these activities without delay? I've been
reading about it, a posible solution are load these activities with
AsincThreads?? but how?Don't know how to apply this solution to my tabLayout
*
I try make my code as efficient as possible, but the delay on create in
main activity continues.
In my path to create an efficient app, I release memory , destroy unused
aditional activities etc.
But, i have other issue when you press the button onback (physical button
of phones).
My first tab, is a RSS on listview, very simple. When I press one of these
news of the RSS, my app start other activity called RSSNew, and i want
that when the users have read the News and press back button, this activity
finished and return it to the RSS tab.
After read so much, I could implement this funcionality with this code:
RSS activity (TAB 1):
/* OnClick Element of List */
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
/* Concrete New */
Intent rssnew = new Intent(view.getContext(), RSSNew.class);
.................
/* Start Activity */
startActivity(rssnew);
}
});
RSSNew activity:
@Override
public void onBackPressed() {
Intent backIntent = new Intent();
backIntent.setClass(getApplicationContext(),MainActivity.class);
backIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(backIntent);
finish();
return;
}
When, I know that when on tabs has changed, the last activity is on paused
state of his Activity life. Therefore, I have some questions:
2.*with this method, is re-created an MainActivity and load the 5
activities?*
3.*With this method, I re create the main activity. But I want to return
to previous activity retaining the status of last this. How I do this?*
4.*I am realizing that this tab system is** very inefficient. Am I wrong?
or did I not know use them properly?*
*
*
*Thanks so much in advance! ;))*
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en