Results 1 to 3 of 3
  1. #1
    Lion is offline Member
    Join Date
    Sep 2013
    Posts
    12
    Rep Power
    0

    Default Crash on Start up with new app, Android Eclipse

    Hi guys, I have been building a new app for practise and come across an issue. When the app is on my Android phone (Galaxy S3) the app crashes. There is not Java code on it yet, all there is so far is a imageButton and some text. I think if anything I have done the @string wrong. Can some kind soul take a look?


    Here is the xml

    Java Code:
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#000000"
        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=".MainActivity" >
    
        <ImageButton
            android:id="@+id/imageButton1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:background="#000000"
            android:scaleType="fitCenter"
            android:src="@drawable/sun" android:contentDescription="@string/Sun"/>
    
        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignTop="@+id/imageButton1"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="36dp"
            android:text="@string/Welcome"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />
    
    </RelativeLayout>
    So now that I have looked at the @strings more I can see that it is wrong!

    But I am not sure how to go about creating a @string. In the string.xml it has the to add new stings ect I name it then it asks for a value? What would go in here for say text or an image ect.

    Is it better to use the string.xml in its text form?


    Thanks guys, I am going to start reading up on @strings

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: Crash on Start up with new app, Android Eclipse

    What error do you get when it crashes?
    It'll be there somewhere in the logs.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Lion is offline Member
    Join Date
    Sep 2013
    Posts
    12
    Rep Power
    0

    Default Re: Crash on Start up with new app, Android Eclipse

    I will take a look

Similar Threads

  1. Emulator doesnt start / Android 4.2.2
    By chrissisWeb in forum Android
    Replies: 1
    Last Post: 05-17-2013, 02:33 PM
  2. Replies: 3
    Last Post: 04-17-2012, 01:15 PM
  3. Android Start
    By Blackberrylerner in forum New To Java
    Replies: 10
    Last Post: 03-01-2011, 04:28 PM
  4. Replies: 1
    Last Post: 01-18-2011, 07:27 PM
  5. Replies: 2
    Last Post: 08-04-2009, 01:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •