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 8841921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:50:14+00:00 2026-06-14T10:50:14+00:00

I have created an android project using eclipse.the default system generated code looked as

  • 0

I have created an android project using eclipse.the default system generated code looked as below

    package com.rmycustomclass.bengler;

    import android.app.Activity;
    import android.os.Bundle;

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

I wanted to try a simple custom control , so i changed the code as below. when i searched the web to create a simple custom control there are mentioned like “create class by subclassing a View”. so tried as below by modifying the code.but it was not running and always force closed.

package com.rmycustomclass.bengler;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class RMyCustomClassActivity extends View {

    private Paint myPaint;

    public RMyCustomClassActivity(Context cxt, AttributeSet attribute){

        super(cxt,attribute);
        init();

    }

    public RMyCustomClassActivity(Context context, AttributeSet attrs, int defStyle)
    {
        super(context, attrs, defStyle);
        init();
    }



    public void init(){

        myPaint = new Paint();
        myPaint.setTextSize(12);
        myPaint.setColor(0xFF668800);
        myPaint.setStyle(Paint.Style.FILL);

    }

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawText("TEEEST", 100, 100, myPaint);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        this.setMeasuredDimension(150,200);     
    }



}

Below is my xml file

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout 
        android:layout_width="fill_parent" 
        xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_height="fill_parent" android:orientation="vertical">

        <TextView 
        android:id="@+id/textView1" 
        android:text="Enter text"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content">
        </TextView>

        <TableLayout 
            android:layout_width="match_parent" 
            android:layout_height="wrap_content" 
            android:id="@+id/tableLayout1">
            <Button 
                android:id="@+id/button2"
                android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="Button"
                 android:layout_weight="1">
            </Button>
            <Button android:layout_width="wrap_content"  android:id="@+id/button1" android:layout_height="40dip" android:text="My button" android:layout_weight="1"></Button>
            <test.control 
              android:id="@+id/control" 
              android:layout_height="match_parent"> </test.control>
        </TableLayout>
    </LinearLayout>
  • 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-06-14T10:50:15+00:00Added an answer on June 14, 2026 at 10:50 am

    When you create a project in eclipse it links your activity (RMyCustomClassActivity in your case) as the launcher in Android manifest…But since you have changed the activity to a View
    android runtime cannot find the activity to launch…See your manifest file and you will find your class as the launcher activity

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

Sidebar

Related Questions

Hello i have created a sample application in android using eclipse IDE my code
I have created a MazeSolver android app for a school project. I am using
i have one doubt,i have created new project in eclipse with android 2.3.1 and
I have created following thing in android using android compatibility support package Basically i
Okay I have a project that is using the android-rss library (org.mcsoxford.rss). I created
I created an Android test project using instrumentation and it works find with eclipse
I am using Eclipse and I am building an Android application. I have created
Project explained below is created and built using Eclipse Juno(4.2). We receive the following
I created an Android project a few months ago and now have to automate
I have created an android application that calls (using kSOAP library) a SOAP based

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.