Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5964093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:22:10+00:00 2026-05-22T19:22:10+00:00

Long time Android user first time developer. I am trying to simply set up

  • 0

Long time Android user first time developer. I am trying to simply set up the fist action of my app which is two buttons one will open the browser and send the user to a URL the other will open a page that gets XML data from a url and shows the value of one node.

BUT FOR NOW I JUST WANT TO KNOW WHY I AM GETTING THE FOLLOWING ERROR:

Description Resource    Path    Location    Type
The type new View.OnClickListener(){} must implement the inherited abstract method View.OnClickListener.onClick(View)   patriosar.java  /com.patriotsar/src/com/patriotsar  line 27 Java Problem

JAVA:

package com.patriotsar;

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


public class patriosar extends Activity {

     private Button startButton;
     private Button subscribe;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        this.findAllViewsById();

        startButton.setOnClickListener(new OnClickListener() {            

        });

        subscribe.setOnClickListener(new OnClickListener() {            

        });

        private void findAllViewsById() {
            start = (Button) findViewById(R.id.startbutton);
            subscribe = (Button) findViewById(R.id.subscribe);
        }

    }
}

MAIN.XML

<?xml version="1.0" encoding="utf-8"?>

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bgimage2"> 
    >

<Button
android:id="@+id/startButton"
android:layout_width="150px"
android:layout_height="wrap_content"
android:text="@string/start"
android:layout_x="80px"
android:layout_y="21px"
>
</Button>

<Button
android:id="@+id/subscribe"
android:layout_width="150px"
android:layout_height="wrap_content"
android:text="@string/subscribe"
android:layout_x="80px"
android:layout_y="74px"
>
</Button>

<TextView
  android:id="@+id/textview"
  android:layout_width="300px"
  android:layout_height="fill_parent"
  android:text="@string/intro"
  android:layout_y="300px"
  android:layout_x="20px"
  android:textColor="#ffffff"
  />
</AbsoluteLayout>

I know it doesnt do anything but not sure why I am already getting errors. Any help would be awesome

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:22:11+00:00Added an answer on May 22, 2026 at 7:22 pm

    You can either implement :

    startButton.setOnClickListener(new View.OnclickListener(){ 
      public void onClick(){
      // do your thing
      } 
    }
    

    or you can do :

    startButton.setOnclickListener(this);
    
     public void onClick(){
       switch(id){
         case R.id.startbutton : //do your thing
          break;
         case R.id.subscribe : //do your thing
          break;
      }
    
    }
    

    You need to implements OnclickListener to your activity, but if you have Eclipse, it’s automatic .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Long time listener, first time caller. I'm a full time SE during the day
Long time ago, the Game Developer magazine published an article about ID Software and
As a long time World of Warcraft player, and a passionate developer I have
As a long time Microsoft developer, I find MSDN to be an invaluable resource.
I'm a long-time emacs user, and I'm now working about 1/2 time in Java.
I'm trying to create a ProgressDialog for an Android-App (just a simple one showing
I am new to Android. I am trying to develop an Alarm Application, which
A long time ago I had an apple ][ . I remember the command
A long time ago when I was a young lat I used to do
A long time ago I saw this trick in Ruby. Instead of doing (for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.