cmd/gomobile: expect GoNativeActivity in external manifests

gomobile expects GoNativeActivity, otherwise current_ctx_clazz stays
null.
Fixed cmd/gomobile/manifest.go to expect GoNativeActivity, and fixed the
network example app.

Change-Id: Idad6f9bec2fcbc876fbd6013009582868ad3e133
Reviewed-on: https://go-review.googlesource.com/12374
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Jae Kwon 2015-07-17 13:50:40 -07:00 committed by David Crawshaw
parent 32ad533813
commit 96f72abd68
2 changed files with 4 additions and 4 deletions

View File

@ -32,8 +32,8 @@ func manifestLibName(data []byte) (string, error) {
if err := xml.Unmarshal(data, manifest); err != nil {
return "", err
}
if manifest.Activity.Name != "android.app.NativeActivity" {
return "", fmt.Errorf("can only build an .apk for NativeActivity, not %q", manifest.Activity.Name)
if manifest.Activity.Name != "org.golang.app.GoNativeActivity" {
return "", fmt.Errorf("can only build an .apk for GoNativeActivity, not %q", manifest.Activity.Name)
}
libName := ""
for _, md := range manifest.Activity.MetaData {

View File

@ -18,9 +18,9 @@ license that can be found in the LICENSE file.
http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms -->
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="network" android:hasCode="false" android:debuggable="true">
<application android:label="network" android:debuggable="true">
<activity android:name="android.app.NativeActivity"
<activity android:name="org.golang.app.GoNativeActivity"
android:label="network"
android:configChanges="orientation|keyboardHidden">
<meta-data android:name="android.app.lib_name" android:value="network" />