English 中文(简体)
BackButton quit the application
原标题:BackButton quit the application

I m experiencing a trouble on my app, my backButton quit the application. My application is a SyncService, everything seems to be great in the Manifest, i check for one day with no response...

I already check if the launchmode change something, i test the 4 and nothing append... If someone can have a look on the manifest, it would be great :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.smile.android.ldapsync" android:versionCode="12" android:versionName="1.5">
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.READ_SYNC_STATS" />
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:enabled="true" android:persistent="true">
        <service android:name="com.smile.android.ldapsync.authenticator.LDAPAuthenticationService" android:exported="true" android:debuggable="true">
            <intent-filter>
                <action android:name="android.accounts.AccountAuthenticator" />
            </intent-filter>
            <meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/authenticator" />
        </service>
        <service android:name="com.smile.android.ldapsync.syncadapter.SyncService" android:exported="true" android:debuggable="true">
            <intent-filter>
                <action android:name="android.content.SyncAdapter" />
            </intent-filter>
            <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/syncadapter" />
        </service>
        <activity android:name="com.smile.android.ldapsync.authenticator.LDAPAuthenticatorActivity" android:label="@string/ui_activity_title" android:excludeFromRecents="true">
            android:excludeFromRecents="true"
                <!--
                No intent-filter here! This activity is only ever launched by
                someone who explicitly knows the class name
            -->
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="5" />
</manifest> 

感谢您;

最佳回答

如果你在“主事”活动(你首先在你的活动中打下了ka子)时报回顿,则本协调员认为,“用户是做的,而且很快就会回头”,而不是“家庭”纽扣地,即“用户可能想在恢复服之前检查其他东西”。

因此,如果你想要“终止”(只有在本组织杀害时,甲状腺和甲状腺才会终止),否则,它将在回顾之前沉积于记忆之中),那么你就必须放弃背后但顿的催复。

public void onBackPressed()

which the api doc describes as:

“在活动发现用户对背钥匙的报章时,会发出警告。 缺席执行只是结束目前的活动,但你可以不做任何事情。

You might just ignore the event and absorb it like timo schloesser suggested or you can do whatever is most appropriated (like, launching another activity or killing services before leaving the screen)

EDIT:你还可能要检查从活动类别中继承的“去除”方法。 我从未使用过这个词,但可能对你的问题有用。

问题回答

你们是否试图凌驾于束手脚?

@Override
public void onBackPressed() {
       return;
}




相关问题
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 ...

热门标签