Andriod Studio:E/AndroidRuntime: FATAL EXCEPTION: main - android

please solve this issue I am a beginner in android development I don't know what the issue is.
Process: com.example.myapplicationofexarth, PID: 2703
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.myapplicationofexarth/com.example.myapplicationofexarth.MainActivity}:
java.lang.ClassCastException:
android.support.constraint.ConstraintLayout cannot be cast to
android.widget.TextView at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106) at
android.os.Looper.loop(Looper.java:193) at
android.app.ActivityThread.main(ActivityThread.java:6669) at
java.lang.reflect.Method.invoke(Native Method) at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused
by: java.lang.ClassCastException:
android.support.constraint.ConstraintLayout cannot be cast to
android.widget.TextView at
com.example.myapplicationofexarth.MainActivity.onCreate(MainActivity.java:15)
at android.app.Activity.performCreate(Activity.java:7136) at
android.app.Activity.performCreate(Activity.java:7127) at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
MainActivity.Java
package com.example.myapplicationofexarth;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
TextView text;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
text=(TextView)findViewById(R.id.textexample);
text.setTextColor(Color.RED);
}
}

looking at the error message I'd say you've probably given the R.Id.textexample to the constraint layout instead of the TextView by accident.
check the Id of the textView in the xml layout.

Related

Error when setting up firebase messaging for background messages in kotlin flutter

My Application.kt contains:
package com.example.somename
import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
FlutterFirebaseMessagingService.setPluginRegistrant(this);
}
override fun registerWith(registry: PluginRegistry?) {
io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
}
}
The error I get when running it:
√ Built build\app\outputs\flutter-apk\app-debug.apk.
E/AndroidRuntime(22518): FATAL EXCEPTION: main
E/AndroidRuntime(22518): Process: com.example.somename, PID: 22518
E/AndroidRuntime(22518): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.somename/com.example.somename.Application}: java.lang.ClassCastException: com.example.somename.Application cannot be cast to android.app.Activity
E/AndroidRuntime(22518): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2843)
E/AndroidRuntime(22518): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
E/AndroidRuntime(22518): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
E/AndroidRuntime(22518): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/AndroidRuntime(22518): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/AndroidRuntime(22518): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
E/AndroidRuntime(22518): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(22518): at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(22518): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/AndroidRuntime(22518): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(22518): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(22518): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/AndroidRuntime(22518): Caused by: java.lang.ClassCastException: com.example.somename.Application cannot be cast to android.app.Activity
E/AndroidRuntime(22518): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
E/AndroidRuntime(22518): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:41)
E/AndroidRuntime(22518): at android.app.Instrumentation.newActivity(Instrumentation.java:1215)
E/AndroidRuntime(22518): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2831)
E/AndroidRuntime(22518):
I have all my imports working fine and everything runs alright when i do not try to implement the background messages feature. The kotlin file is also being called correctly in my Manifest file.
I'm not sure of exactly what I'm doing wrong and any insight will be helpful! Thanks.

Android in-app purchase billing client crashes on build

I am new to Android in-app purchases. I have followed the official documentation and I can't go beyond building the BillingClient as app crashes when it tries to build the BillingClient. Any help or any reference to a android in-app purchases in Java is much appreciated. My MainActivity.java codes is as follows:
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.BillingClientStateListener;
import com.android.billingclient.api.BillingResult;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.PurchasesUpdatedListener;
import java.util.List;
public class MainActivity extends AppCompatActivity{
private PurchasesUpdatedListener purchaseUpdateListener = new PurchasesUpdatedListener() {
#Override
public void onPurchasesUpdated(BillingResult billingResult, List<Purchase> purchases) {
// To be implemented in a later section.
}
};
private BillingClient billingClient = BillingClient.newBuilder(MainActivity.this)
.setListener(purchaseUpdateListener)
.enablePendingPurchases()
.build();
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Crash Log is as follows:
2020-07-07 01:19:40.667 27956-27956/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.js.bs, PID: 27956
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.js.bs/com.js.bs.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3272)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3500)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:122)
at com.android.billingclient.api.BillingClientImpl.initialize(com.android.billingclient:billing##3.0.0:26)
at com.android.billingclient.api.BillingClientImpl.<init>(com.android.billingclient:billing##3.0.0:13)
at com.android.billingclient.api.BillingClientImpl.<init>(com.android.billingclient:billing##3.0.0:1)
at com.android.billingclient.api.BillingClient$Builder.build(com.android.billingclient:billing##3.0.0:14)
at com.js.bs.MainActivity.<init>(MainActivity.java:31)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:41)
at android.app.Instrumentation.newActivity(Instrumentation.java:1253)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3260)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3500) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:223) 
at android.app.ActivityThread.main(ActivityThread.java:7523) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941) 
2020-07-07 01:19:41.044 27956-27956/? I/Process: Sending signal. PID: 27956 SIG: 9
Please change the billingClient object creation as below. While creating this object from outside the context may be null, so crashing. Move the object creation to onCreate() method of the activity.
private BillingClient billingClient;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
billingClient = BillingClient.newBuilder(this)
.setListener(purchaseUpdateListener)
.enablePendingPurchases()
.build();
}

ViewModel class constantly returns Runtime and IllegalAccessException

I posted this question yesterday but I think that I might not have been very clear with the doubt.
In the line where I use ViewModel to link up with MainActivity using the ViewProvider, the code returns the Runtime Exception. Additionally, the code also returns the message "Cannot create an instance of class at com.example.viewmodelpractice.ViewModelStorage".
The error message points specifically at this line:
viewModelStorage = new ViewModelProvider(this).get(ViewModelStorage.class);
Here are the rest of the classes:
ViewModelStorage.java
package com.example.viewmodelpractice;
import androidx.lifecycle.ViewModel;
class ViewModelStorage extends ViewModel {
private String name;
private String age;
String getName() {
return name;
}
void setName(String name){
this.name = name;
}
String getAge() {
return age;
}
void setAge(String age){
this.age = age;
}
}
Main Activity.java
package com.example.viewmodelpractice;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProvider;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private EditText nameEditText;
private EditText ageEditText;
private TextView resultTextView;
private ViewModelStorage viewModelStorage;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
nameEditText = findViewById(R.id.name_notice_editText);
ageEditText = findViewById(R.id.age_notice_editText);
resultTextView = findViewById(R.id.result_textView);
viewModelStorage = new ViewModelProvider(this).get(ViewModelStorage.class);
storeDataMethod();
}
private void storeDataMethod() {
viewModelStorage.setName(nameEditText.getText().toString());
viewModelStorage.setAge(ageEditText.getText().toString());
getDataMethod();
}
private void getDataMethod() {
resultTextView.setText(("Hey there, ").concat(viewModelStorage.getName().concat(". You are ").concat(viewModelStorage.getAge()).concat(" years old.")));
}
}
Error Message
2020-05-04 12:06:38.744 20688-20688/com.example.viewmodelpractice E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.viewmodelpractice, PID: 20688
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.viewmodelpractice/com.example.viewmodelpractice.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.viewmodelpractice.ViewModelStorage
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.RuntimeException: Cannot create an instance of class com.example.viewmodelpractice.ViewModelStorage
at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:223)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:187)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150)
at com.example.viewmodelpractice.MainActivity.onCreate(MainActivity.java:27)
at android.app.Activity.performCreate(Activity.java:7224)
at android.app.Activity.performCreate(Activity.java:7213)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:201) 
at android.app.ActivityThread.main(ActivityThread.java:6823) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 
Caused by: java.lang.IllegalAccessException: java.lang.Class<com.example.viewmodelpractice.ViewModelStorage> is not accessible from java.lang.Class<androidx.lifecycle.ViewModelProvider$NewInstanceFactory>
at java.lang.Class.newInstance(Native Method)
at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:219)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:187) 
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150) 
at com.example.viewmodelpractice.MainActivity.onCreate(MainActivity.java:27) 
at android.app.Activity.performCreate(Activity.java:7224) 
at android.app.Activity.performCreate(Activity.java:7213) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:201) 
at android.app.ActivityThread.main(ActivityThread.java:6823) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Instead of this:
class ViewModelStorage extends ViewModel {
Make it like this:
public class ViewModelStorage extends ViewModel {
Due to this, you are getting the IllegalAccessException!

java.lang.NullPointerException: Attempt to invoke virtual method parse

Trying to use parse server with AWS
I have tried several tutorials seems like I am missing somehing simple just don't know what it is
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.davidavila.myapplication, PID: 6492
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.davidavila.myapplication/com.example.davidavila.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.parse.ParsePlugins.getParseDir()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.parse.ParsePlugins.getParseDir()' on a null object reference
at com.parse.ParseCorePlugins.getCurrentInstallationController(ParseCorePlugins.java:267)
at com.parse.ParseInstallation.getCurrentInstallationController(ParseInstallation.java:56)
at com.parse.ParseInstallation.getCurrentInstallation(ParseInstallation.java:62)
at com.example.davidavila.myapplication.MainActivity.onCreate(MainActivity.java:21)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
I/Process: Sending signal. PID: 6492 SIG: 9
package com.example.davidavila.myapplication;
import com.parse.Parse;
import com.parse.ParseInstallation;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ParseInstallation.getCurrentInstallation().saveInBackground();
Parse.enableLocalDatastore(this);
Parse.initialize (new Parse.Configuration.Builder(this)
.applicationId("1b5f82b054262c169a8bcc4b5a1f379cbac8bfd5")
.clientKey("f9f3b809dbada7fb5ed7793630e21893fb80fea3")
.server("http://13.58.197.143:80/parse/")
.build()
);
}
public void buttonMain (View view) {
Intent intent = new Intent(this, landingPage.class);
startActivity(intent);
}
}
Expect not to have an issue
Please try as follows
Parse.enableLocalDatastore(MainActivity.this);
Parse.initialize(new Parse.Configuration.Builder(MainActivity.this)
.applicationId("1b5f82b054262c169a8bcc4b5a1f379cbac8bfd5")
.clientKey("f9f3b809dbada7fb5ed7793630e21893fb80fea3")
.server("http://13.58.197.143:80/parse/")
.enableLocalDataStore()
.build());

My code is throwing an error [Fatal error: Main] can you tell me why?

I'm creating all the objects after onCreate and setContentView but I'm still getting the error [Fatal Error: Main] and it makes my app crash. I've seen people face the same problem but it's when they make objects for their EditText above the setContentView tag and I've tried moving it around but it's just not working for me hope you can help me. I'll provide you guys with the code... Thanks
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//-----------------------------------------------------------------------------------------------------------------------
//ASSIGNING
final EditText name=(findViewById(R.id.editText));
final EditText date=(findViewById(R.id.editText3));
EditText month=(findViewById(R.id.editText4));
final EditText year=(findViewById(R.id.editText5));
Button b=(findViewById(R.id.button));
//-----------------------------------------------------------------------------------------------------------------------
//NAME NUMBER
String s= name.getText().toString();
char[] n=s.toCharArray();
int i,total=0;
The Error I'm getting:-
2019-02-09 13:24:08.085 6934-6934/com.example.numerologysolutions E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.numerologysolutions, PID: 6934
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.numerologysolutions/com.example.numerologysolutions.MainActivity}: java.lang.NumberFormatException: For input string: ""
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.Integer.parseInt(Integer.java:627)
at java.lang.Integer.parseInt(Integer.java:650)
at com.example.numerologysolutions.MainActivity.onCreate(MainActivity.java:81)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
That's the problem according to your error stack trace. You're trying to convert a string to a number.
Caused by: java.lang.NumberFormatException: For input string: ""

Categories

Resources