English 中文(简体)
B. 系统.exit()与杀装置之间的区别
原标题:difference between System.exit() and killProcess()
  • 时间:2011-09-30 00:57:26
  •  标签:
  • android

What s the difference if I call System.exit() vs. killProcess().
I am interested in difference only

最佳回答

我原想 存在任何差别。 虽然有系统,但你应当叫作主食。 第一期

问题回答

我们应使用什么?

页: 1 是否公开申请?

它视像系统一样,在所有方面,视之为杀人,但更简单,较少依赖其他东西。

有些人建议采用一种治理方法。 关于Exit,但根据被认为不安全、截至1.0年逐步取消的docs,我猜测忽略了这一部分。

与其他建议相反,完成()并不会结束正在运行的含水层过程,而不会腾出用于评估的所有记忆。

配给和刺roid的设计使很多情况下没有具体需要实际撤出 app。 (如果你出于任何原因想要杀害你的 app,则 later子会杀你们的旧 app,那么,如果你真的想要杀死你的 app子,那似乎是想法。 它关闭了正在运行的java虚拟机器,因此,所有资源、记忆和透镜都将完全消失。

(请注意,你可在你的明确档案中说明,有些线索应处于不同的线性过程——在这种情况下,案件系统(exit)可能只会杀死你的部分 app——但这种 st势更严重。)

As a matter of fact, I just ran adb shell ps|grep app and I see the com.example.android.lunarlander sample app which I haven t run in about a week -- still in memory, still taking up almost 100000 bytes of memory.

Neither. Use finish(). See this, and the link aromero recommended. Let Android do what what it is meant to do: manage your activity life-cycle. It was designed this way for a reason.





相关问题
Android - ListView fling gesture triggers context menu

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, ...

AsyncTask and error handling on Android

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 ...

Android intent filter for a particular file extension?

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 ...

Android & Web: What is the equivalent style for the web?

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 ...

TiledLayer equivalent in Android [duplicate]

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?

Using Repo with Msysgit

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 ...

Android "single top" launch mode and onNewIntent method

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 ...

From Web Development to Android Development

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 ...

热门标签