0
首先,我知道這已被問及之前,我已經經歷了許多這方面的許多帖子。不幸的是,我的情況似乎有點不同。大多數帖子建議從應用程序標籤中刪除權限聲明。不幸的是,這並沒有幫助我的情況,因爲我沒有在應用程序標籤內部擁有權限。我非常感謝任何幫助。Android - 啓動器無權啓動意圖
這裏是我的AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jonasSoftware.blueharvest"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.jonasSoftware.blueharvest.LoginActivity"
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.jonasSoftware.blueharvest.ChargeActivity"
android:label="@string/title_activity_charge" >
</activity>
<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.jonasSoftware.blueharvest.HomeActivity"
android:label="Home" >
</activity>
<activity
android:name="com.jonasSoftware.blueharvest.ConfigActivity"
android:label="Config" >
</activity>
<activity
android:name="com.jonasSoftware.blueharvest.SettingsActivity"
android:label="Settings" >
</activity>
<activity android:name=".WebServiceDemo" android:label="WebServiceDemo"/>
<activity android:name=".UploadActivity"/>
<activity android:name=".TransferActivity"/>
<activity android:name=".ReceivePO"/>
<activity android:name=".LoginActivity"/>
</application>
</manifest>
的LoginActivity,如果需要的話,在下面。出於測試目的,它只是啓動HomeActivity意圖,大部分代碼被註釋掉。
public class LoginActivity extends Activity {
// JSON Response node names
private static String KEY_SUCCESS = "success";
private static String KEY_ERROR = "error";
private static String KEY_ERROR_MSG = "error_msg";
private static String KEY_UID = "uid";
private static String KEY_NAME = "name";
private static String KEY_USERNAME = "username";
private static String KEY_CREATED_AT = "created_at";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
setTitle("onas Scanner Login");
final Button loginBtn = (Button) findViewById(R.id.btnLogin);
final EditText loginUsername = (EditText) findViewById(R.id.loginUsername);
final EditText loginPassword = (EditText) findViewById(R.id.loginPassword);
final TextView loginErrorMsg = (TextView) findViewById(R.id.login_error);
loginBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//do stuff
String username = loginUsername.getText().toString();
String password = loginPassword.getText().toString();
Intent homeActivity = new Intent(getApplicationContext(), HomeActivity.class);
homeActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(homeActivity);
}
});
}
}
如果需要其他信息,請告訴我。