android-tabs

Failed to load map. Error contacting Google servers. This is probably an authentication issue

这一生的挚爱 提交于 2019-11-26 10:34:18
I search all days and I can't find the answer... everything is ready but google map still can't show on fragment with tab I check that I already turn on google map android v2 and right API_KEY I have no idea what happened! MainActivity.java: public class MainActivity extends FragmentActivity implements ActionBar.TabListener { SectionsPagerAdapter mSectionsPagerAdapter; ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String titles[] = { this.getString(R.string.title_around), this

Android SlidingTabLayout with icons

大兔子大兔子 提交于 2019-11-26 09:30:51
问题 I am using google\'s SlidingTabLayout in my view, but i want to add icons to the tabs. I\'m using this http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html Can anyone please help? void setUpPager(View view){ mViewPager = (ViewPager) view.findViewById(R.id.viewpager); mViewPager.setAdapter(new TabsPagerAdapter(getActivity())); mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs); mSlidingTabLayout.setViewPager

Adding Tab inside Fragment In Android?

时间秒杀一切 提交于 2019-11-26 09:19:36
问题 I am trying to add a TabHost inside a Fragment. The code is given below. Here inside the Fragment. I am trying to add TabHost to show two Tabs: package com.nordicsoft.dilosysNewVersion; import android.app.Fragment; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TabHost; public class Fragment_Coupons extends Fragment { TabHost tabHost; TabHost.TabSpec spec; public

Creating tabs using Fragments now that TabActivity is deprecated

耗尽温柔 提交于 2019-11-26 05:37:47
问题 I am creating an application which has five tabs at the bottom of the screen, each of which opens a different Activity. My Tab Activity extends TabActivity which I have just read is deprecated and I should use Fragments instead. How do I change my app to use Fragments instead? I have read the information on android.developer.com but I still have no idea how to do this. 回答1: You will need to use the android compatibility library to use fragments. It can be found as a jar file in your android

How do I change a tab background color when using TabLayout?

雨燕双飞 提交于 2019-11-26 05:21:15
问题 This is my code in the main activity public class FilterActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_filter); // Get the ViewPager and set it\'s PagerAdapter so that it can display items ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager); PageAdapter pageAdapter = new PageAdapter(getSupportFragmentManager(), FilterActivity.this); viewPager.setAdapter

TabWidget current tab bottom line color

不羁的心 提交于 2019-11-26 03:22:21
问题 I have a TabWidget for which I have enabled and set the stripLeft and stripRight ... mTabHost.getTabWidget().setStripEnabled(true); mTabHost.getTabWidget().setRightStripDrawable(R.drawable.redline); mTabHost.getTabWidget().setLeftStripDrawable(R.drawable.redline); As you can see in the image below, this does not change the bottom line color of the currently selected tab (TAB 2). How can I change the bottom line color of the currently selected tab which is defaulted to blue at the moment? (I

Failed to load map. Error contacting Google servers. This is probably an authentication issue

夙愿已清 提交于 2019-11-26 02:11:00
问题 I search all days and I can\'t find the answer... everything is ready but google map still can\'t show on fragment with tab I check that I already turn on google map android v2 and right API_KEY I have no idea what happened! MainActivity.java: public class MainActivity extends FragmentActivity implements ActionBar.TabListener { SectionsPagerAdapter mSectionsPagerAdapter; ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

TabWidget current tab bottom line color

徘徊边缘 提交于 2019-11-25 19:16:17
I have a TabWidget for which I have enabled and set the stripLeft and stripRight ... mTabHost.getTabWidget().setStripEnabled(true); mTabHost.getTabWidget().setRightStripDrawable(R.drawable.redline); mTabHost.getTabWidget().setLeftStripDrawable(R.drawable.redline); As you can see in the image below, this does not change the bottom line color of the currently selected tab (TAB 2). How can I change the bottom line color of the currently selected tab which is defaulted to blue at the moment? (I am guessing the blue color is being set in the default AppTheme style in styles.xml .) I looked at this