0

My problem is when I open new activity when pressing button an error accoutred "Unfortunately, ISPcheck has stopped".
Here is my MainActivity.java button click event code:

public void btnLogin_OnClick(View view) {
        startActivity(new Intent(MainActivity.this, PersonInfo.class));
    }

Here is button xml code in activity_main.xml:

<Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="تسجيل الدخول"
            android:id="@+id/btnLogin"
            android:layout_marginTop="72dp"
            android:textColor="#ffffff"
            android:layout_below="@+id/txtPassword"
            android:layout_centerHorizontal="true"
            android: önClick="btnLogin_OnClick" /
>

Here is AndroidManifest.xml code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hsa.ispcheck"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.hsa.ispcheck.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>
        <activity
            android:name="com.hsa.ispcheck.PersonInfo"
            android:label="@string/title_activity_person_info" >
        </activity>
    </application>

</manifest>

So, What's wrong with what I did?

Note: I'm using Android Studio v0.3.2

Edited by Rasool Ahmed: Add note

5
Contributors
4
Replies
21
Views
4 Years
Discussion Span
Last Post by jonese068
0

1) You need to post full stacktrace of the error not single line you provided above
2) new Intent need start with context getContext()

0

In Android Studio, you will have a Logcat view which will give you a stack trace of the exception. We'll need that to figure out where what goes wrong.

-1

I think we can not help you because the code is not clear, as Peter mentioned above You need to post full stacktrace of the error not single line

Edited by stevecolin101: spelling error

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.