Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360084 - Type onClickListener cannot be resolved to a type
Summary: Type onClickListener cannot be resolved to a type
Status: RESOLVED INVALID
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 07:37 EDT by sai_rajarajan CLA
Modified: 2011-10-06 10:57 EDT (History)
1 user (show)

See Also:


Attachments
onClickListener cannot be resolved to a type (1.11 KB, application/octet-stream)
2011-10-06 07:50 EDT, sai_rajarajan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description sai_rajarajan CLA 2011-10-06 07:37:18 EDT
Build Identifier: Eclipse Classic 3.7

I am a  new android apps developer, I am creating a new sudoku apps derived from org.example.sudoku; this is my code, given below.

package org.example.sudoku;

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

public class SudokuActivity extends Activity implements onClickListener
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        View continueButton = this.findViewById(R.id.Continue_button);
        continueButton.setOnClickListener(this);
        
    }
    public void onClick(View v)
    {
    	switch (v.getId())
    	{
    	case R.id.about_button:
    		Intent i = new Intent(this, about.class);
    		startActivity(i);
    		break;
    		
    	}
    	
    }
}


here onClickListener and setOnClickListener has marked as red line and display error as Type onClickListener cannot be resolved to a type for OnClickListener, and The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (SudokuActivity) error for setOnClickListener. so and I tried to clear the error using Ctrl+Shift+o. When I tried, that time the imports android.view.View.onClickListener is automatically removed from Activity. so What can i do? How I correcting the errors. Please help me.

Reproducible: Always
Comment 1 sai_rajarajan CLA 2011-10-06 07:50:59 EDT
Created attachment 204661 [details]
onClickListener cannot be resolved to a type

Please verify my code, give correct suggestion to me. 

the errors show in below
1.onClickListener cannot be resolved to a type
2.The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (SudokuActivity)
3.The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (SudokuActivity)
4.The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (SudokuActivity)
5.The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (SudokuActivity)
6.The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (SudokuActivity)
Comment 2 Curtis Windatt CLA 2011-10-06 10:57:34 EDT
This is not a bug report.  It does not relate to PDE.  For help with code design, you can try using the Eclipse forums http://www.eclipse.org/forums.

The type OnClickListener doesn't exist where you think it does.  You can see if it is available in your workspace at all by using open type Ctrl-Shift-T.  I expect that it is not available, in which case the android plug-in is missing code you require.