activitygroup

Android 1.6 & Fragment & Tabhost

梦想的初衷 提交于 2019-12-03 18:49:24
问题 I'm working on upgrading an Android application (1.6 compatibility) which uses a TabHost to show 3 different tabs with nested activities. At the time I used the ActivityGroup trick to show nested activities in a tab but I'm very unhappy with this method since it's a real pain to handle some features. I heard about the Fragments API compatibility package for 1.6 and a Fragment looks perfect for what I want to do (show nested views / features within a tab with transition effects and stuff) but

Slide transition animation in a ActivityGroup on Android

[亡魂溺海] 提交于 2019-12-03 14:12:39
问题 I want to add slide transition animation while changing activities within a ActivityGroup. I have used following function to change activities using intent: public void replaceContentView(String id, Intent newIntent) { View view = getLocalActivityManager().startActivity(id, newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)) .getDecorView(); history.add(view); this.setContentView(view); } Any suggestion how can I do that? 回答1: add animation to the view Example public void replaceContentView

Android: activity transition/animation in ActivityGroup

孤街醉人 提交于 2019-12-03 09:15:59
I use ActivityGroup to manage activities, I want to add animation when change activity, the code I used to change to next activity is: Intent intent = new Intent(getParent(), AnotherActivity.class); TabGroupActivity parentActivity = (TabGroupActivity) getParent(); parentActivity.startChildActivity("AnotherActivity", intent); And inside startChildActivity : Window window =getLocalActivityManager().startActivity(Id,intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)); if (window != null) { View view = window.getDecorView(); mIdList.add(Id); setContentView(view); } TabGroupActivity is just an

Slide transition animation in a ActivityGroup on Android

不想你离开。 提交于 2019-12-03 04:03:57
I want to add slide transition animation while changing activities within a ActivityGroup. I have used following function to change activities using intent: public void replaceContentView(String id, Intent newIntent) { View view = getLocalActivityManager().startActivity(id, newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)) .getDecorView(); history.add(view); this.setContentView(view); } Any suggestion how can I do that? add animation to the view Example public void replaceContentView(String id, Intent newIntent) { View view = getLocalActivityManager().startActivity(id, newIntent.addFlags

Android: AsyncTask ProgressDialog will not open in ActivityGroup

孤人 提交于 2019-12-03 03:07:55
I am trying to have a a progress dialog open when polling my server. The class is an ActivityGroup because it is nested within a tab bar. To keep the view within the frame, the ActivityGroup is needed. Here is the declaration of my ActivityGroup class: public class CheckInActivity extends ActivityGroup{ ... public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.checkin); new LocationControl().execute(this); Now my AsyncTask class is within the same CheckInActivityClass as such: private class LocationControl extends AsyncTask<Context, Void,

Back button behavior with tabs and ActivityGroup

跟風遠走 提交于 2019-12-02 08:20:21
I have an Activity ( Main ) which shows tabs like this: private void initTabs(){ mTabHost = getTabHost(); // The activity TabHost Intent intent; intent = new Intent().setClass(this, MyGroup.class); setupTab(intent, "tab"); } private void setupTab(Intent intent, final String tag) { View tabview = createTabView(mTabHost.getContext(), tag); TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(intent); mTabHost.addTab(setContent); } private static View createTabView(final Context context, final String text) { View view = LayoutInflater.from(context).inflate(R.layout.tabs

Android: Viewing Two Activities in One Screen

偶尔善良 提交于 2019-12-01 17:48:42
I'm looking for the simplest way to have two activities displayed at once, so that one Activity always remains visible, and the other changes with user interaction. In other words: I currently have code for a program with several Activities. The user can navigate between these activities. I want to add a new Activity that will always be visible alongside what I already have. When the user navigates from the current Activity to another one, this new "side Activity" will remain visible. I've seen many different ideas for doing something similar, but haven't been able to adapt them to my needs.

Android ActivityGroup - NullPointerException

删除回忆录丶 提交于 2019-12-01 14:46:14
I'm trying to use activity groups - since I use tabs, and want to have the tabs when loading and activity after the list item was clicked,. but I'm getting nullpointerexception in the following line: View view1 = S1_Group.group.getLocalActivityManager() .startActivity("S1", intent) .getDecorView(); Code is .. . lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(getApplicationContext(), S1.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); Log.d("test","Before view"); try{ View

How to navigate from activity in one activity group to another activity in android

感情迁移 提交于 2019-12-01 12:40:25
问题 I have two tabs. In these two tabs I have different activity groups. How to navigate from an activity in one activity group to another activity in android? Please help me with suitable examples. 回答1: To programmatically switch between tabs use the TabHost method setCurrentTab(int index) or setCurrentTabByTag(String tag) . The user can also click the tab UI (if used) to switch between them. 回答2: in my case i did like this when i click on finish/submit button in last activity of parent group ,

Android实现通用的ActivityGroup(效果类似Android微博客户端主界面),...

无人久伴 提交于 2019-12-01 07:19:11
可以说ActivityGroup是Google提供的一个非常优秀的API,但它需要做稍微复杂的重写才能用起来比较方便,本文拟将实现这个稍微复杂的重写。TabActivity作为ActivityGroup唯一的子类却让人大失所望。 首先来说ActivityGroup的优秀之处以及它的必要性,它为开发者提供了一种可能,这种可能不将Activity作为屏幕的顶级元素(Context)呈现,而是嵌入到ActivityGroup当中。这是一种极大的飞跃,它将场景(Context)细分化了,ActivityGroup是一个主场景,而用户可以通过导航按钮来切换想要的子场景。如使用微博功能,它是一个相当宏大的场景,具有看最新的广播信息、自己发微博、修改资料等子场景,用户可以通过按钮来切换到想要的子场景,而这个子场景仍活动于主场景之中。让一个主场景能拥有多个逻辑处理模块,主场景不再负责子场景逻辑,主场景只负责切换场景的逻辑,即每一个Activity(子场景)拥有一个逻辑处理模块,一个ActivityGroup有多个Activity,却不干预Activity的逻辑,这无疑细分化和模块化了逻辑代码。ActivityGroup和它将要内嵌的Activity所要实现的功能完全可以用只一个Activity来完成,你可以试想