• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Source Code Not Found?

Ryanteck

Member
Hey guys
im trying to create a image button app but it always comes up with source code not found?
i have tryed it using diffrent project bases ( 2.1 and 1.6)

why wont it work?
my code is below
Code:
package com.ryanteck.buttontest;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class easybutton extends Activity {
    /** Called when the activity is first created. */
    @SuppressWarnings("unused")
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button button = (Button)findViewById(R.id.ImageButton01);
        TextView text = (TextView)findViewById(R.string.hello);
        
        button.setOnClickListener(new View.OnClickListener() {
        @SuppressWarnings("null")
		public void onClick(View v) {
        TextView text = null;
		text.setText("button pressed");

        }
        });
        }
        
    }
 
Altough i have killed my android i still would like to know how i could fix this problem ? there must be some way to fix it
 
well you need to make sure, build path is set properly and pre-requisites of android app are there.
another thing, is also not right -
TextView text = null;
text.setText("button pressed");
 
Back
Top Bottom