我愿知道,在方向变化时,能否要求安乐施不要重载一项活动(我想重载他人,但把这 !)。
我已经检查了我可以列入清单的活动性质,但似乎没有人允许这样做。
感谢!
我愿知道,在方向变化时,能否要求安乐施不要重载一项活动(我想重载他人,但把这 !)。
我已经检查了我可以列入清单的活动性质,但似乎没有人允许这样做。
感谢!
为此:
public boolean onRetainNonConfigurationInstance() {
return true;
}
public onCreate() {
if(getLastNonConfigurationInstance() != null) {
finish();
}
}
很简单,在你的活动中,它凌驾于onConfiguration 改动(建筑群),并在其中杀死有关活动。
注
@Override
public void onConfigurationChanged (Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
finish();
}
这将使活动在组合发生变化时丧生。 在选择了你的活动方向。 你们可以检查一下它正在改变的哪类方向,看看看新的复杂情况,并把它与混杂类的孔隙和景观相提并论。
我愿知道,在方向变化时,能否要求安乐施不要重载一项活动(我想重载他人,但把这 !)。
Possible? Sure. A good idea? No. Users will get very confused if a simple twist of their wrist causes the current activity to go away. They might think that your app is broken.
理想的做法是,允许用户以他们想要的任何方向利用你的活动。 这不是你。
如果出于某种原因,某些活动只在一种方向(例如景观)中具有意义,则使用<代码>android:orientation <>/code>vide in the <>
s in the expression,以保持这一方向。
I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...
I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...
I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...
I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...
To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?
When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...
I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...
I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...