开发者

android Orientation of screen creating problem

I have created an App, when my app start its shows a image and I have set ScreenOrientation="sensor" in manifest.

but when I rotate my device my app crashes.

sometime its shows image in portrait mode or landscape mode.

can anybody please help me.

how can I set orientation of screen accor开发者_如何学Goding to sensor.

Thanks


your activity in your Manifest file is:: and also stop or intrupted yout thread while completing the work

Main problem is your background Thread is running and when you change orientation the new view is generated and try to access old view so app crashes....

<activity android:name=".SensorTest"
        android:windowSoftInputMode="adjustPan"  android:screenOrientation="sensor"
        android:configChanges="keyboardHidden|orientation">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
        </intent-filter>
    </activity>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜