DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Results 1 to 4 of 4

Thread: Android app help!!!

  1. Junior Droid
    smithmanny's Avatar
    Member #
    95706
    Join Date
    Jul 2010
    Location
    Atlanta, GA
    Posts
    8
    Twitter
    smithmanny
    Phone
    Thunderbolt
    #1

    Android app help!!!

    I am trying to make my image button clickable and send it to another screen so it can display info. Can someone help me with the code?!
    Here is my code:
    package com.member.ofwgkta;

    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.ImageButton;



    public class MainActivity extends Activity {
    private ImageButton domoButton;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    domoButton = (ImageButton) findViewById(R.id.domo);
    domoButton.setOnClickListener(new OnClickListener() {

    public void onClick(View v) {
    Intent intent = new Intent(home.this, Activity2.class);
    startActivity(intent);
    // TODO Auto-generated method stub

    }

    });
    }
    }
  2.  
     
     
     
  3. Droid
    naDroid.com's Avatar
    Member #
    171234
    Join Date
    Feb 2011
    Location
    Canton, OH
    Posts
    36
    Liked
    1 times
    Twitter
    dixon07
    Phone
    G'nex
    #2

    Error?

    What error are you getting in Logcat? Did you add Activity2 to your manifest?
  4. Junior Droid
    smithmanny's Avatar
    Member #
    95706
    Join Date
    Jul 2010
    Location
    Atlanta, GA
    Posts
    8
    Twitter
    smithmanny
    Phone
    Thunderbolt
    #3
    Quote Originally Posted by naDroid.com View Post
    What error are you getting in Logcat? Did you add Activity2 to your manifest?
    Ya i added activity2 to my manifest the error i'm getting is
    "home cannot be resolved to a type"
  5. Droid
    naDroid.com's Avatar
    Member #
    171234
    Join Date
    Feb 2011
    Location
    Canton, OH
    Posts
    36
    Liked
    1 times
    Twitter
    dixon07
    Phone
    G'nex
    #4

    Should be easy

    Change "home.this" to "this".
    All you should need for context is the keyword "this".

Links

Posting Permissions

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

Similar Threads

  1. Replies: 8
    Last Post: 01-27-2011, 09:11 AM
  2. Replies: 20
    Last Post: 01-21-2011, 07:33 PM
  3. android boys android girls android familes
    By froyooo in forum Android Accessories
    Replies: 7
    Last Post: 12-16-2010, 02:49 AM
  4. Replies: 8
    Last Post: 06-16-2010, 06:56 PM

Search tags for this page

android home cannot be resolved

,

home cannot be resolved, android

Click on a term to search our site for related topics.
Find us on Google+