android-viewpager

How to update first and second page view in view pager.?

≯℡__Kan透↙ 提交于 2020-01-06 19:49:05
问题 I have View-pager with nine images. I am setting images in view using bitmap. When i choose nine images from gallery first time, its show all nine images perfectly. Also when i choose another nine images from gallery with keep first first or second view same,view-pager display with updated images. But my problem is when I am trying to change all nine images with first and second. they display error like OutOfMemoryEror . so my question is. How to update first and second(next) view in view

getSupportFragmentManager().findFragmentById returning Null

泪湿孤枕 提交于 2020-01-06 16:20:01
问题 What I am doing : updating UI (Fragment UI) from Broadcast Receiver. But while finding Fragment I am getting null in return. OnReceive (Broadcast Receiver): if(MainActivity.getInstace()!=null){ MainActivity.getInstace().updateUI(); } MainActivity.class (Fragment Activity): public void updateUI() { MainActivity.this.runOnUiThread(new Runnable() { public void run() { //getting null here SlidingTab frag = (SlidingTab)getSupportFragmentManager().findFragmentByTag("slidingtab"); frag.updateUI(); }

getSupportFragmentManager().findFragmentById returning Null

不打扰是莪最后的温柔 提交于 2020-01-06 16:19:44
问题 What I am doing : updating UI (Fragment UI) from Broadcast Receiver. But while finding Fragment I am getting null in return. OnReceive (Broadcast Receiver): if(MainActivity.getInstace()!=null){ MainActivity.getInstace().updateUI(); } MainActivity.class (Fragment Activity): public void updateUI() { MainActivity.this.runOnUiThread(new Runnable() { public void run() { //getting null here SlidingTab frag = (SlidingTab)getSupportFragmentManager().findFragmentByTag("slidingtab"); frag.updateUI(); }

Can I put a fragement in a viewpager in an extra container?

陌路散爱 提交于 2020-01-06 15:16:06
问题 Is it possible to put one of the fragments in a viewpager inside a framelayout? My idea was to do something like this: <android.support.v4.view.ViewPager android:id="@+android:id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" /> </android.support.v4.view.ViewPager> What I would to do is have all fragments in the viewpager, except for one, that

Change action bar tab text colour

别说谁变了你拦得住时间么 提交于 2020-01-06 12:43:46
问题 I have an application which uses action bar with swipes. I have tabs with title like Tab1, Tab2, Tab3. I want to set different color of each of tab title. Tab1 (Red) Tab2(Blue) (Tab3)green. I have searched and came up with way to use TabHost, But I don't want to use it. Is there any other way to achieve this. Here is main Activity public class MainActivity extends FragmentActivity implements ActionBar.TabListener { SectionsPagerAdapter mSectionsPagerAdapter; ViewPager mViewPager; @Override

Viewpager sound not synchronised with image

谁说我不能喝 提交于 2020-01-06 12:42:57
问题 So basically i want to play a short sound when user swipes the images. There are number of images & sound i taken in this. Sound is playing fine But my problem is here my sound is not matches the image. May be i think i have not implemented OnPageChangeListener in my code. Can any one help me in this how do i implement this code.. package com.android.learning_numbers; import android.media.MediaPlayer; import android.os.Bundle; import android.os.IBinder; import android.app.Activity; import

Android ViewPager using a single Fragment on multiple pages

帅比萌擦擦* 提交于 2020-01-06 10:43:17
问题 I'm having a bit of trouble having the ViewPager displaying and running properly with a single fragment class. So a bit of background. The Activity itself is supposed to allow users to answer questions in a survey. Each question consists of a question title, an input box, and a submit button. I've made a layout and a corresponding fragment (QuestionFragment) class to hold all of this. My idea is to have the ViewPager hold a bunch of QuestionFragment's and the user will be able to swipe to the

Android ViewPager using a single Fragment on multiple pages

偶尔善良 提交于 2020-01-06 10:42:40
问题 I'm having a bit of trouble having the ViewPager displaying and running properly with a single fragment class. So a bit of background. The Activity itself is supposed to allow users to answer questions in a survey. Each question consists of a question title, an input box, and a submit button. I've made a layout and a corresponding fragment (QuestionFragment) class to hold all of this. My idea is to have the ViewPager hold a bunch of QuestionFragment's and the user will be able to swipe to the

Android ViewPager using a single Fragment on multiple pages

99封情书 提交于 2020-01-06 10:40:45
问题 I'm having a bit of trouble having the ViewPager displaying and running properly with a single fragment class. So a bit of background. The Activity itself is supposed to allow users to answer questions in a survey. Each question consists of a question title, an input box, and a submit button. I've made a layout and a corresponding fragment (QuestionFragment) class to hold all of this. My idea is to have the ViewPager hold a bunch of QuestionFragment's and the user will be able to swipe to the

onActivityResult() is not called when startActivityResult() is called from Child Fragment in ViewPager

坚强是说给别人听的谎言 提交于 2020-01-06 08:27:07
问题 I have read through the related posts. In every quaestion I see that onActivityResult() of activity gets called at least..the problem is how to carry the result to the fragments or nested fragments. But issue I am facing is different. I am implementing Settings page that will have tabs with TabLayout from new Design Support library. In my app I have a single Activity which holds other Fragments...so I added a SettingsTabFragment which has ViewPager and a FragmentPagerAdapter to it.This