Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: Why it shows error ?

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Thanked 0 Times in 0 Posts

    Angry Why it shows error ?

    package com.example.helloworld;
    import android.support.v7.app.ActionBarActivity;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.TextView;
    public class MainActivity extends ActionBarActivity {
    	TextView view;
    	EditText inpuText;
    	Button okayButton;
        protected void onCreate(Bundle savedInstanceState) {
            view = (TextView) findViewById(R.id.textView1stActivity);
            inpuText=(EditText) findViewById(R.id.editText1);
            okayButton=(Button) findViewById(R.id.button1);
            okayButton.setOnClickListener(new OnClickListener() { //in this line setOnClickListene this methods shows error
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
        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;
        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);
    Last edited by devils; October 8th, 2014 at 08:55 AM.

Similar Threads

  1. how to calculate the result of a student and shows if pass and failed
    By SulemanAyub786 in forum Object Oriented Programming
    Replies: 2
    Last Post: June 3rd, 2014, 06:47 PM
  2. Complies but shows null expection on console
    By harris186 in forum Threads
    Replies: 1
    Last Post: April 7th, 2014, 03:03 PM
  3. button doesnt shows up on the screen
    By poldz123 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 20th, 2013, 07:35 AM
  4. Mutiple classfile, JPanel nothing shows up
    By Lorack in forum AWT / Java Swing
    Replies: 71
    Last Post: June 25th, 2012, 02:58 PM
  5. Table with CustomModel when clicked shows old entry
    By Nesh108 in forum AWT / Java Swing
    Replies: 6
    Last Post: November 9th, 2011, 06:38 AM