Soru & Cevap

FATAL EXEPTİON.MAİN

06.11.2015 - 12:08

İyi Akşamlar ; Yeni Başlamaya çalışan biriyim FATAL EXCEPTİON MAİN Hatası veriyor. Nerde hata yapıyorum yardımcı olabilirseniz sevinirim

 

 

1.Ekran.XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/first_activity_edittext_passing_data"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:hint="@string/write_something" />

    <Button
        android:id="@+id/first_activity_button_send"
        android:layout_marginTop="20dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Send" />
</LinearLayout>

1.Ekran.Java

package com.rda.passingData;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class FirstActivity extends Activity {
    private EditText passingDataEdittext;
    private Button sendButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.first_activity);
        initViews();
        setClickables();
    }
    private void initViews() {
        passingDataEdittext = (EditText) findViewById(R.id.first_activity_edittext_passing_data);
        sendButton = (Button) findViewById(R.id.first_activity_button_send);
    }
    private void setClickables() {
        sendButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View arg0) {
                Log.i("Veri Gönderme", passingDataEdittext.getText().toString());
                Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
                startActivity(intent);
            }
        });
    }
}

2.Ekran.XML

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#00ff00"
    android:gravity="center"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/second_activity_textview_coming_data"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#ffffff"
        android:textSize="20sp"
        android:textStyle="bold" />

</LinearLayout>

2.Ekran.Java

package com.rda.passingData;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class SecondActivity extends Activity {
    private TextView inComingDataTextView;
    
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
         
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second_activity);
        initViews();
        setViews("DENEME TEXT");
    }
private void initViews (){
     inComingDataTextView=(TextView) findViewById(R.id.second_activity_textview_coming_data);
}        
    private void setViews(String comingtext){
        inComingDataTextView.setText(comingtext);
        
    }
    
    
    

}

Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.rda.passingData"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity android:name="com.rda.passingData.FirstActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            </activity>
            <activity android:name="com.rda.passingData.SeconActivity" >
        </activity>
    </application>

</manifest>

FATAL EXCEPTİON

11-05 21:01:53.056: I/Veri Gönderme(984): 123
11-05 21:01:53.064: D/AndroidRuntime(984): Shutting down VM
11-05 21:01:53.064: W/dalvikvm(984): threadid=1: thread exiting with uncaught exception (group=0xa62a5288)
11-05 21:01:53.144: E/AndroidRuntime(984): FATAL EXCEPTION: main
11-05 21:01:53.144: E/AndroidRuntime(984): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.rda.passingData/com.rda.passingData.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1541)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1416)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.app.Activity.startActivityForResult(Activity.java:3351)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.app.Activity.startActivityForResult(Activity.java:3312)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.app.Activity.startActivity(Activity.java:3522)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.app.Activity.startActivity(Activity.java:3490)
11-05 21:01:53.144: E/AndroidRuntime(984):     at com.rda.passingData.FirstActivity$1.onClick(FirstActivity.java:32)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.view.View.performClick(View.java:4084)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.view.View$PerformClick.run(View.java:16966)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.os.Handler.handleCallback(Handler.java:615)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.os.Looper.loop(Looper.java:137)
11-05 21:01:53.144: E/AndroidRuntime(984):     at android.app.ActivityThread.main(ActivityThread.java:4745)
11-05 21:01:53.144: E/AndroidRuntime(984):     at java.lang.reflect.Method.invokeNative(Native Method)
11-05 21:01:53.144: E/AndroidRuntime(984):     at java.lang.reflect.Method.invoke(Method.java:511)
11-05 21:01:53.144: E/AndroidRuntime(984):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-05 21:01:53.144: E/AndroidRuntime(984):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-05 21:01:53.144: E/AndroidRuntime(984):     at dalvik.system.NativeStart.main(Native Method)

 

3 Görüntülenme

1 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-7661-1418285218.jpg
zafermuhammed93
06.11.2015 - 04:44
Kardeşim manifest.XML de second aktiviteyi default olarak belirtmemissin. Bak first aktiviten launcher yazan yeri aynen kopyala oraya default yap bir daha denermisin o yüzden gibi
cihat
06.11.2015 - 08:17
Çok Teşekkürler Hata manifest'ten kaynaklanıyoruş düzeldi :)