Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Unfortunately (apps) has stopped in Eclipse Emulator
Unfortunately (apps) has stopped in Eclipse Emulator [message #1717270] Fri, 11 December 2015 10:05 Go to next message
Al Mozahid is currently offline Al MozahidFriend
Messages: 1
Registered: December 2015
Junior Member
Hi,
I am newbie. I have created a simple apps. While I run it I got "Unfortunately Phonebook has stopped" in Emulator.

Here is my code:

Activitymain.xml

<RelativeLayout xmlns:android="//schemas.android.com/apk/res/android"
    xmlns:tools="//schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.phonebook_rhd.MainActivity" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="190dp"
        android:text="@string/Phonebook"
        android:textSize="20sp" />

</RelativeLayout>


Selectamenu.xml

<RelativeLayout xmlns:android="//schemas.android.com/apk/res/android"
    xmlns:tools="//schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.phonebook_rhd.MainActivity" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="41dp"
        android:text="@string/Select"
        android:textSize="20sp" />

</RelativeLayout>


Mainactivity.java

package com.example.phonebook_rhd;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;

import android.os.Bundle;

import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends Activity implements OnClickListener{

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		
			};   
	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

	@Override
	public void onClick(DialogInterface arg0, int arg1) {
		// TODO Auto-generated method stub
		
	}
}


AndroidManifest.xml

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

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

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

</manifest>
Re: Unfortunately (apps) has stopped in Eclipse Emulator [message #1717334 is a reply to message #1717270] Fri, 11 December 2015 19:21 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3071
Registered: July 2009
Senior Member
This is NOT the place for Android programming questions. Please read the Announcement posts a the top of the Newcomers forum page.
Previous Topic:Adjust tab-space and mouse pointer?
Next Topic:ECLIPSE HELP!!!! ERROR #13 and ERROR #1 [Can't locate path!] - SKYPE HELP!!!
Goto Forum:
  


Current Time: Mon Sep 16 12:42:09 GMT 2019

Powered by FUDForum. Page generated in 0.02680 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top