android-tabactivity

How do I clear the map of All points and markers and routes when switching tabs with a tab host

匆匆过客 提交于 2020-01-17 07:47:11
问题 I created an App that uses Google Maps to get the users current location and draw routes. Recently I converted this app to a TabHost with five tabs. Because of this I now need a way to clear and restart the map whenever a user clicks on that tab. How can I do this. Below is the layout.xml and activity code for my map. activity_map_view.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android

How to avoid starting the activity at the first tab in a TabActivity?

二次信任 提交于 2020-01-05 19:59:31
问题 i want to avoid starting activity in the first tab .. tabHost.setCurrentTab(1). When the tab activity starts, I expect that only the activity in tab 2 gets started. But, currently, Android starts both activity in tab 1 and activity in tab 2, if I set tab 2 as default current tab import android.app.TabActivity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.widget.TabHost; import

Intent to open a specific tab of tabbed activity

断了今生、忘了曾经 提交于 2019-12-21 23:33:56
问题 I have a tabbed activity with 5 tabs. Each tab has only one Imageview. On a previous page I have 5 buttons and I want to create an interface such that each button starts the tabbed activity but the first tab which is visible is specific to that button. eg. gallery apps open a specific tab corresponding to the thumnail of the photo and are also left/right swappable. 回答1: You can pass the tab id you want to open as an extra to the Intent you are creating. Then in the tabbed Activity , assuming

Android change Fragment page

大憨熊 提交于 2019-12-20 07:47:10
问题 you can download my zip here ok so i made an app with Swipe+Tab View i want each tab to show a diffrent .xml page if u click above you can download my workspace to edit it .. i really need help please be spicific to if u want i can setup teamviwer if it could be faster.. if u dont want to download the file cause u think "it has a virus" just make a reply down below here is my code for the mainactivity.java package twh.reviser.root; import java.util.Locale; import android.os.Bundle; import

Adding an intent to a TabActivity in Android

拈花ヽ惹草 提交于 2019-12-20 06:06:08
问题 I checked up some online tutorials on how to build a TAB in android and saw a tutorial that fit my requirements. I was happy to implement it and it worked well. The problem came when I wanted each separate tab to push to one separate activity. I couldn't start and intent to pass on the control. I've given only the main code as to how I am making the Tab's as the xml required for the construction does not have any functionality in this question. Here is the code: public class Secondactivity

java.lang.StackOverflowError while adding new activity in activity group

不羁的心 提交于 2019-12-14 01:40:08
问题 I am getting stackoverflow error My layout structure as below <TabActivity> <tab1><Activity name="home"> <tab2><Activitygroup><activity name="XYZ"> <activity name="options"> <activity name="thankYou"> <tab3> <TabActivity> <tab3.1><Activitygroup><activities name="PQR"> <tab3.2><activity name="today"> <tab3.3><activity name="history"> <tab3.4><Activitygroup> <activity name="reOrder"> from this I will open <Activity name="options"> <TabActivity> <tab4><Activitygroup><activities name="ABC"> <tab5

Scheduled Task in Fragment returns getActivity as null

陌路散爱 提交于 2019-12-12 21:05:59
问题 I know similar type of question is asked before. Sorry to ask again. I have a fragment in a tab FragmentActivity. Within the fragment in onActivityCreated , I have to schedule a task after every fix interval. Timer t = new Timer(); t.scheduleAtFixedRate(new TimerTask() { @Override public void run() { getActivity().runOnUiThread(new Runnable() { @Override public void run() { new fetchDataInBackground(ctx).execute(); //async task } }); } }, 0, 20000); The above code works perfectly fine, until

Google map doesn't load into my app device

喜欢而已 提交于 2019-12-12 01:23:24
问题 I am newbie to android development. I am learning on my own using internet and following tutorials. I am making an app which have 3 tabs , one is for location second is for camera and third is for pictures . For this i am using a tabbed activity inside android studio . Inside it i am using mapView and followed this tutorial and done each step used in it. Moreover i have my apiKey for google map. Below are my codes Manifest <uses-permission android:name="com.example.accurat.faisal.permission

TabGroupActivity - startChildActivity - not working

孤者浪人 提交于 2019-12-11 19:27:50
问题 I have been using TabActivity and I want the tab to display on every child activity. I have flow like this MainActivity(TabActivity) -> TabGroupActivity1(TabGroupActivity) -> Activity1 -> Activity2 Now i want to redirect on Activity2 only if the flag is true. so that my code for that is something like bellow. TabGroupActivity public class TabGroupActivity extends ActivityGroup { private ArrayList<String> mIdList; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

How can I logout from my application and refresh on android?

时光怂恿深爱的人放手 提交于 2019-12-11 10:36:18
问题 I am new in android, I need to ask this question. I build some android application that implement the TabLayout, so every activity is held by every tab on my app. But before it, we should face the Login activity. My question is how can I Logout when we are in the Tab Activity, and how can I refresh it in every activity on that tab? I have 3 tab, and I implement menu to "logout" and "refresh", and also have menu for "about". Here is my sample code on TabActivity, but I just implement toast in