Hey,
Check your syntax in you manifest.
You have closed the activity tag in the wrong place.
Your code:
<activity android:name=".ActivityTesting"
android:label="@string/app_name"> <-<-<-<
This is your problem
android:configChanges="orientation"
Should be:
<activity android:name=".ActivityTesting"
android:label="@string/app_name"
android:configChanges="orientation"> <-<-<-<
The android:configChanges should be inside tag tag.
Make the change and see if it sorts the problem.
Matt
On Aug 16, 7:35 am, "pramod.deore" <[email protected]> wrote:
> Ok I had tried it but it doesn't work. Look I had developed one simple
> application in that only I had print one line in onCreate method, but
> each time when I change screen orientation that statement print (i.e.
> which I had write in onCreate() method)
>
> Here is my code
>
> import android.app.Activity;
> import android.content.res.Configuration;
> import android.os.Bundle;
>
> public class ActivityTesting extends Activity
> {
> /** Called when the activity is first created. */
> @Override
> public void onCreate(Bundle savedInstanceState)
> {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.main);
> System.out.println ("Inside onCreate");
> }
>
> public void onConfigurationChanged(Configuration newConfig)
> {
> super.onConfigurationChanged(newConfig);
> }
>
> }
>
> and xml file is like
>
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
> package="com.micro.activity"
> android:versionCode="1"
> android:versionName="1.0">
> <application android:icon="@drawable/icon" android:label="@string/
> app_name">
> <activity android:name=".ActivityTesting"
> android:label="@string/app_name">
> android:configChanges="orientation"
> <intent-filter>
> <action android:name="android.intent.action.MAIN" />
> <category
> android:name="android.intent.category.LAUNCHER" />
> </intent-filter>
> </activity>
>
> </application>
> <uses-sdk android:minSdkVersion="4" />
>
> </manifest>
>
> and LogCat contains following output
> 08-16 12:04:05.338: DEBUG/dalvikvm(388): GC freed 142 objects / 5848
> bytes in 294ms
> 08-16 12:04:08.068: INFO/ActivityManager(74): Starting activity:
> Intent { act=android.intent.action.MAIN
> cat=[android.intent.category.LAUNCHER] flg=0x10200000
> cmp=com.micro.activity/.ActivityTesting }
> 08-16 12:04:08.168: INFO/ActivityManager(74): Start proc
> com.micro.activity for activity com.micro.activity/.ActivityTesting:
> pid=846 uid=10051 gids={}
> 08-16 12:04:08.368: INFO/dalvikvm(846): Debugger thread not active,
> ignoring DDM send (t=0x41504e4d l=38)
> 08-16 12:04:08.438: INFO/dalvikvm(846): Debugger thread not active,
> ignoring DDM send (t=0x41504e4d l=40)
> 08-16 12:04:08.548: INFO/System.out(846): Inside onCreate
> 08-16 12:04:08.698: INFO/ActivityManager(74): Displayed activity
> com.micro.activity/.ActivityTesting: 557 ms (total 557 ms)
> 08-16 12:04:10.838: INFO/WindowManager(74): Setting rotation to 1,
> animFlags=1
> 08-16 12:04:10.849: INFO/WindowManager(74): Config changed:
> { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=2/1/1 nav=3 orien=2
> layout=18}
> 08-16 12:04:10.978: INFO/System.out(846): Inside onCreate
> 08-16 12:04:11.078: DEBUG/StatusBar(74): updateResources
>
> Here it prints two times Inside onCreate. One at the start of
> application and another time when I close the keyboard of G1 mobile.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en