Sms Gratis Indosat

Phone Numbers
0 -
Example : 83832867987 Without 0

Type your Messages

Question: + =

NullPointerException of ViewPager when change orientation

In my last exercise of "ViewPager", when change orientation, NullPointerException will be thrown in onSaveInstanceState()!

May be it's a bug in ViewPager. Note the class ViewPager is currently under early design and development. May be it will be fixed in later updates.

At this moment, my solution is to comment the statement to call super.onSaveInstanceState(outState).

 @Override
protected void onSaveInstanceState(Bundle outState) {
//super.onSaveInstanceState(outState);
outState.putInt("tab", getActionBar().getSelectedNavigationIndex());
}


Next:
- Communication between Fragments in ViewPager

Volga GAZ V12 Coupe

V12 / 5.576 cc / 385 PS / 406 ft/lb (550 Nm) @ 4.000 / 0 - 62 mph (100 km/h): 6,6 s / Vmax: 155 mph (250 km/h)

(click images for a larger view)









Add Android Support Package

I have a old post "Install and setup Compatibility Package" describe how to include Android Support Package in Java Build Path. I try again it recently, it seem that the method no longer work! When work with android.support.v4.app.FragmentActivity, java.lang.ClassNotFoundException will be thrown.

It can be solved by Add Support Library in Eclipse menu.
- New a Android project target Android 3.0 (API Level 11).

- Modify AndroidManifest.xml to specify minSdkVersion and targetSdkVersion:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="11"/>

- Add Android Support Library.
Right click on the project in Eclipse, select Android Tools, Add Support Library...

Add Support Library...


Accept to install Android Support.

install Android Support Package


- Test it
Modify your activity extends FragmentActivity instead Activity, and import android.support.v4.app.FragmentActivity.

Now you can run it without error.

 
Copyright © 2015. About - Web Version - Mobile Version Sitemap - Contact - Privacy