Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Android] Custom Native Activity  (Read 1558 times)

0 Members and 1 Guest are viewing this topic.

CytraL

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • GitHub
[Android] Custom Native Activity
« on: December 01, 2014, 01:22:38 am »
Hi, its possible create a custom NativeActive?

Something like this...?

AndroidManifest.xml
Code: [Select]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="es.redneboa.fingership"
    android:versionCode="12"
    android:versionName="2.5" >

<......................>

    <activity android:name=".FingerShipNative"
              android:label="@string/app_name"
              android:icon="@drawable/ic_launcher"
              android:configChanges="keyboardHidden|screenSize"
              android:screenOrientation="portrait">
       
        <meta-data android:name="android.app.lib_name" android:value="sfml-activity" />       
        <meta-data android:name="sfml.app.lib_name" android:value="fingership" />

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
       
    </activity>


FingerShipNative.java
Code: [Select]
package es.redneboa.fingership;

import android.app.NativeActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

public class FingerShipNative extends NativeActivity {
    static final String TAG = "FingerShip";
   
    private static NativeActivity me = null;


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle)
    {
    AndroidUtils.showTooltipAlert(this, "Test...");
   
        super.onCreate(icicle);
        me = this;
    }
   
    public static void openURL(String url)
    {     
        Intent i = new Intent(Intent.ACTION_VIEW); 
        i.setData(Uri.parse(url));
        me.startActivity(i);
}
}

My Project:


I get this error:
Code: [Select]
12-01 01:17:54.086: E/AndroidRuntime(25324): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{es.redneboa.fingership/es.redneboa.fingership.FingerShipNative}: java.lang.ClassNotFoundException: Didn't find class "es.redneboa.fingership.FingerShipNative" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
Thx.
« Last Edit: December 01, 2014, 01:38:15 am by CytraL »
dev@redneboa.es | WordPress | GitHub | YouTube