誰かが私を助けることができます....EMDK Androidスタジオ
私はSymbol TC75スキャナから覚えていません。私は私のアプリにインテントを送るセットアッププロファイルを持っています。私のアプリはヌルインテントを受け取ります。
私は私が実際のデバイス上でこのアプリをプレイした後、私はログ
でこのエラーを取得し、このEMDKResults results = EMDKManager.getEMDKManager(this.getApplicationContext(), this);
if(results.statusCode == STATUS_CODE.FAILURE)
{
//Failed to create EMDKManager object
}
Intent i = getIntent();
handleDecodeData(i);
@Override
public void onNewIntent(Intent i) {
handleDecodeData(i);
}
private void handleDecodeData(Intent i) {
if (i.getAction().contentEquals("com.draganm.mpreiscontainertracking.BARCODE")) {
String data = i.getStringExtra("com.motorolasolutions.emdk.datawedge.data_string");
if (data != null && data.length() > 0) {
}
Toast.makeText(this, data, Toast.LENGTH_LONG).show();
}
}
を置く.... mainfestファイル内のonCreateで
<uses-permission android:name="com.symbol.emdk.permission.EMDK" />
<uses-library android:name="com.symbol.emdk"/>
<activity
android:name=".aufladen"
android:screenOrientation="portrait"
android:launchMode="singleTask">
<intent-filter>
<action android:name="com.draganm.mpreiscontainertracking.BARCODE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
をこのコードを入れています
FATAL EXCEPTION: main
Process: com.draganm.mpreiscontainertracking, PID: 5163
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.draganm.mpreiscontainertracking/com.draganm.mpreiscontainertracking.aufladen}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.contentEquals(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.contentEquals(java.lang.CharSequence)' on a null object reference
at com.draganm.mpreiscontainertracking.aufladen.handleDecodeData(aufladen.java:610)
at com.draganm.mpreiscontainertracking.aufladen.onCreate(aufladen.java:101)
at android.app.Activity.performCreate(Activity.java:6012)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
'私は.getActionは() '私は解決策を見つけた検索の日後 –