Hi there! I am a beginner to Android Studio and right now trying to create an app with the functionality of trying to display a splash screen and then after 5 seconds, the app will change the layout from the Splashscreen to the login page. I
This are the code i have attempted to used but failed causing the app to crash.
Code:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Thread startTimer = new Thread() {
public void run() {
try {
sleep(5000);
Intent i = new Intent(MainActivity.this, Login_Page.class);
startActivity(i);
finish();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
startTimer.start();
}}
I have a total of 4 layouts
1) Activity_main.xml
2) Content_main.xxml
3) login.xml
4) splash.xml
I have 3 acitivities
1) Login_page
2) MainAcitvity
3) Splash
Error Code
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities
E/AndroidRuntime: FATAL EXCEPTION: Thread-148
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: Process: com.yong.combinedhuamtities, PID: 3495
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.yong.combinedhuamtities/com.yong.combinedhuamtities.Login_Page}; have you declared this activity in your AndroidManifest.xml?
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1794)
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:3917)
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:3877)
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:784)
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4200)
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4168)
12-04 15:28:47.209 3495-3547/com.yong.combinedhuamtities E/AndroidRuntime: at com.yong.combinedhuamtities.MainActivity$1.run(MainActivity.java:25)
12-04 15:28:47.673 3495-3582/com.yong.combinedhuamtities E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb3f97710
Would appreciate if any professional programmer can explain the error of mine... Thank you!
Read the message:
Unable to find explicit activity class {com.yong.combinedhuamtities/com.yong.combinedhuamtities.Login_Page};
have you declared this activity in your AndroidManifest.xml?
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
</activity>
a26484306 said:
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
</activity>
Click to expand...
Click to collapse
Thanks for your help!!!
Related
xposed framework handleLoadPackage、 initZygote method not execute.
manifest configuration :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="htt:://schemas.android.com/apk/res/android"
package="com.android.xdemo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- xposed -->
<meta-data
android:name="xposeddescription"
android:value="xposed test demo" />
<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposedminversion"
android:value="54" />
<activity
android:name="com.android.xdemo.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
------------------------
xposed_init configuration :
com.android.xdemo.XDemoMain
---------------------
XDemoMain class :
package com.android.xdemo;
import java.io.File;
import android.os.Environment;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_LoadPackage.Lo adPackageParam;
public class XDemoMain implements IXposedHookLoadPackage, IXposedHookZygoteInit {
@override
public void initZygote(StartupParam startupParam) throws Throwable {
try {
String sd = Environment.getExternalStorageDirectory().getAbsol utePath();
new File(sd, "test").createNewFile();
} catch (Exception e) {
}
}
@override
public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
try {
String sd = Environment.getExternalStorageDirectory().getAbsol utePath();
new File(sd, "demo").createNewFile();
} catch (Exception e) {
}
}
}
------------------------------------------------------
These are configured according to the official document, Xposed framework can also be installed on the phone looking for in the module is handleLoadPackage, initZygote these two methods have not been called, did not seem to come in this class, there is not a configuration mistake, please great God pointing
SplashAcvtivity.java File
Code:
package com[.]nijinsha.didyouknow;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.os.Handler;
/**
* Created by Digit on 3/17/2016.
*/
public class SplashActivity extends AppCompatActivity {
// Splash screen timer
private static int SPLASH_TIME_OUT = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
/*
* Showing splash screen with a timer. This will be useful when you
* want to show case your app logo / company
*/
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
Intent i = new Intent(SplashActivity.this, MainActivity.class);
startActivity(i);
// close this activity
finish();
}
}, SPLASH_TIME_OUT);
}
Manifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.nijinsha.didyouknow">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true">
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar"
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize">
</activity>
</application>
</manifest>
LOG FILE
03-17 14:53:21.490 7053-7053/com.nijinsha.didyouknow E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nijinsha.didyouknow, PID: 7053
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nijinsha.didyouknow/com.nijinsha.didyouknow.SplashActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378)
at android.app.ActivityThread.access$800(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5433)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:340)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:309)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:273)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.nijinsha.didyouknow.SplashActivity.onCreate(SplashActivity.java:21)
at android.app.Activity.performCreate(Activity.java:5301)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2291)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378)*
at android.app.ActivityThread.access$800(ActivityThread.java:155)*
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)*
at android.os.Handler.dispatchMessage(Handler.java:102)*
at android.os.Looper.loop(Looper.java:136)*
at android.app.ActivityThread.main(ActivityThread.java:5433)*
at java.lang.reflect.Method.invokeNative(Native Method)*
at java.lang.reflect.Method.invoke(Method.java:515)*
This line
Code:
at com.nijinsha.didyouknow.SplashActivity.onCreate(Sp lashActivity.java:21)
suggest that app crash in:
Code:
setContentView(R.layout.activity_splash);
Your activity extends AppCompatActivity, but in manifest You declared for this activity:
Code:
android:theme="@android:style/Theme.Black.NoTitleBar" >
You need to use another theme for this acitivty.
You must use AppCompat themes with activity that extended from AppCompatActivity class,
Code:
android:theme="@android:style/Theme.AppCompat.Light"
or don't extend your activity from AppCompatActivity.
Code:
public class SplashActivity extends Activity
EDIT: FOUND THE BUG!
Turns out that Android's Instant Run feature does not work with Xposed. I turned it off and the module ran perfectly.
Kinda sad that I spent hours just staring at my code trying to find a bug. I guess I'll submit an issue on GitHub to update the tutorial. Hopefully other developers will see that a lot quicker
===============
Hey guys, I'm new to developing Xposed modules and have been following the Xposed development guide that Rovo made on GitHub. I understand how Xposed works and have tried to recreate the tutorial on Android Studio myself. However, when I load the module, I keep getting a java.lang.ClassNotFoundException. I was hoping that someone could take a look at my (very short) code and tell me if I am forgetting to do something.
Here is the error I am getting:
Code:
05-19 11:03:15.591 4049-4049/? I/Xposed: Loading modules from /data/app/com.tejasvinareddy.xposed.tutorial-1/base.apk
05-19 11:03:15.636 4049-4049/? I/Xposed: Loading class com.tejasvinareddy.xposed.tutorial.Main
05-19 11:03:15.637 4049-4049/? E/Xposed: java.lang.ClassNotFoundException: Didn't find class "com.tejasvinareddy.xposed.tutorial.Main" on path: DexPathList[[zip file "/data/app/com.tejasvinareddy.xposed.tutorial-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at de.robv.android.xposed.XposedBridge.loadModule(XposedBridge.java:497)
at de.robv.android.xposed.XposedBridge.loadModules(XposedBridge.java:457)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:122)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.tejasvinareddy.xposed.tutorial.Main" on path: DexPathList[[zip file "/system/framework/XposedBridge.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 4 more
Suppressed: java.lang.ClassNotFoundException: com.tejasvinareddy.xposed.tutorial.Main
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 5 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
AndroidManifest.xml
Code:
<manifest xmlns:android="<<CAN'T POST LINK CAUSE I'M NEW ugh>>"
package="com.tejasvinareddy.xposed.tutorial">
<application android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="Teju's first Xposed module" />
<meta-data
android:name="xposedminversion"
android:value="53" />
</application>
</manifest>
The app's build.gradle file:
Code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.tejasvinareddy.xposed.tutorial"
minSdkVersion 15
targetSdkVersion 23
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
provided 'de.robv.android.xposed:api:82'
provided 'de.robv.android.xposed:api:82:sources'
}
My main code:
Code:
package com.tejasvinareddy.xposed.tutorial;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
public class Main implements IXposedHookLoadPackage {
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam)
throws Throwable {
XposedBridge.log("TUTORIAL: Loaded app " + lpparam.packageName);
}
}
And finally xposed_init:
Code:
com.tejasvinareddy.xposed.tutorial.Main
Are there any other files that I could be messing up?
Hello,
i am trying to launch my app on a samsung galaxy s3, but the activity doesn't launch
can someone help me?
error:
06-14 08:36:58.720 24601-24601/plopmenzinc.nsapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: plopmenzinc.nsapp, PID: 24601
java.lang.RuntimeException: Unable to start activity ComponentInfo{plopmenzinc.nsapp/plopmenzinc.nsapp.Start}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2436)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)
at android.app.ActivityThread.access$900(ActivityThread.java:170)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5635)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at plopmenzinc.nsapp.Start.onCreate(Start.java:37)
at android.app.Activity.performCreate(Activity.java:5580)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2400)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)*
at android.app.ActivityThread.access$900(ActivityThread.java:170)*
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304)*
at android.os.Handler.dispatchMessage(Handler.java:102)*
at android.os.Looper.loop(Looper.java:146)*
at android.app.ActivityThread.main(ActivityThread.java:5635)*
at java.lang.reflect.Method.invokeNative(Native Method)*
at java.lang.reflect.Method.invoke(Method.java:515)*
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)*
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)*
at dalvik.system.NativeStart.main(Native Method)*
start.java:
package plopmenzinc.nsapp;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.nfc.NfcAdapter;
import android.os.CountDownTimer;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageSwitcher;
import android.widget.TextView;
import android.widget.Toast;
public class Start extends AppCompatActivity {
int number = 0;
private ImageSwitcher sw;
public static final String MIME_TEXT_PLAIN = "text/plain";
public static final String TAG = "NfcDemo";
private TextView mTextView;
private NfcAdapter mNfcAdapter;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
sw.setImageResource(R.drawable.reclame);
if (mNfcAdapter == null) {
// Stop here, we definitely need NFC
Toast.makeText(this, "U kunt deze functie helaas niet gebruiken, omdat uw toestel geen NFC heeft.", Toast.LENGTH_LONG).show();
finish();
return;
}
if (!mNfcAdapter.isEnabled()) {
mTextView.setText("Om deze functie te gebruiken moet u NFC aanzetten.");
}
handleIntent(getIntent());
}
@override
protected void onResume() {
super.onResume();
/**
* It's important, that the activity is in the foreground (resumed). Otherwise
* an IllegalStateException is thrown.
*/
setupForegroundDispatch(this, mNfcAdapter);
}
@override
protected void onPause() {
/**
* Call this before onPause, otherwise an IllegalArgumentException is thrown as well.
*/
stopForegroundDispatch(this, mNfcAdapter);
super.onPause();
}
@override
protected void onNewIntent(Intent intent) {
/**
* This method gets called, when a new Intent gets associated with the current activity instance.
* Instead of creating a new activity, onNewIntent will be called. For more information have a look
* at the documentation.
*
* In our case this method gets called, when the user attaches a Tag to the device.
*/
handleIntent(intent);
}
private void handleIntent(Intent intent) {
TextView var = (TextView) findViewById(R.id.score);
number++;
String disp = Integer.toString(number);
var.setText(disp);
final TextView CountDown = (TextView) findViewById(R.id.textView3);
new CountDownTimer(300000, 1000) {
public void onTick(long millisUntilFinished) {
CountDown.setText(millisUntilFinished / 1000 + " sec");
}
public void onFinish() {
CountDown.setText("0 sec");
}
}.start();
}
/**
* @param activity The corresponding {@link Activity} requesting the foreground dispatch.
* @param adapter The {@link NfcAdapter} used for the foreground dispatch.
*/
public void setupForegroundDispatch(final Activity activity, NfcAdapter adapter) {
final Intent intent = new Intent(activity.getApplicationContext(), activity.getClass());
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
final PendingIntent pendingIntent = PendingIntent.getActivity(activity.getApplicationContext(), 0, intent, 0);
IntentFilter[] filters = new IntentFilter[1];
String[][] techList = new String[][]{};
// Notice that this is the same filter as in our manifest.
filters[0] = new IntentFilter();
filters[0].addAction(NfcAdapter.ACTION_NDEF_DISCOVERED);
filters[0].addCategory(Intent.CATEGORY_DEFAULT);
try {
filters[0].addDataType(MIME_TEXT_PLAIN);
} catch (IntentFilter.MalformedMimeTypeException e) {
throw new RuntimeException("Check your mime type.");
}
adapter.enableForegroundDispatch(activity, pendingIntent, filters, techList);
}
public void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
adapter.disableForegroundDispatch(activity);
}
public void image_next(){
sw.setImageResource(R.drawable.reclame);
}
public void image_prev(){
sw.setImageResource(R.drawable.reclame2);
}
}
activity:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="(link)"
xmlns:tools="(link)"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
androidrientation="vertical"
androidaddingBottom="@dimen/activity_vertical_margin"
androidaddingLeft="@dimen/activity_horizontal_margin"
androidaddingRight="@dimen/activity_horizontal_margin"
androidaddingTop="@dimen/activity_vertical_margin"
tools:context="plopmenzinc.nsapp.Start"
android:saveEnabled="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Uw aantal punten:"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="50dp"
android:singleLine="true"
android:textColor="#FF2646B0"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/disp"
android:id="@+id/score"
android:layout_alignBottom="@+id/textView"
android:layout_toRightOf="@+id/textView"
android:layout_toEndOf="@+id/textView"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tijd tot U weer kunt scannen:"
android:id="@+id/textView2"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="34dp"
android:singleLine="true"
android:textColor="#FF2646B0"
android:textSize="22sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0 sec"
android:id="@+id/textView3"
android:singleLine="true"
android:textSize="22sp"
android:layout_alignTop="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:layout_toEndOf="@+id/textView2" />
<ImageSwitcher
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageSwitcher"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="275dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="prev"
android:id="@+id/button"
android:layout_alignTop="@+id/button2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="54dp"
android:layout_marginStart="54dp"
androidnClick="image_prev" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="next"
android:id="@+id/button2"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/textView3"
android:layout_alignEnd="@+id/textView3"
androidnClick="image_next" />
</RelativeLayout>
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="(link)"
package="plopmenzinc.nsapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Start">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.NFC" />
<uses-feature
android:name="android.hardware.nfc"
android:required="true" />
<activity
android:name="net.vrallev.android.nfc.demo.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</activity>
</manifest>
need to get this finished before thursday, so please help me
Well, thus far I see that you are making references to parts of the Layout View but I am not seeing where you are declaring your TextView / ImageView inside your XML layout, see below:
Code:
sw.setImageResource(R.drawable.reclame);
mTextView.setText("Om deze functie te gebruiken moet u NFC aanzetten.");
You need to have something like:
mTextView = (TextView)findViewbyId(R.id.TextViewId);
sw = (ImageView)findViewById(R.id.ImageViewId);
Fix those, try again and then return.
Hi together
If i create a signed bundle release, the debuger adds the android studio release number in the AndroidManifest.xml file and throws an error
i know there should not been any numbers in the package name, but why adds AS this every time?
here are the error message:
C:\Users\dev\AndroidStudioProjects\newsapp\app\build\intermediates\bundle_manifest\release\AndroidManifest.xml:2: AAPT: error: attribute 'package' in <manifest> tag is not a valid Android package name: 'com.acme.newsapp.1.4.30'.
The AndroidManifest.xml in the project folder:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.acme.newsapp">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@Mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@Mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activ..
The build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.30'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
In the debug version this doesnt happen, only on the signed release
my Android Studio Version is the 4.1.2
Anyone a idea why this happens?