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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:20:50+00:00 2026-05-18T20:20:50+00:00

I am completly new to android programming and I try to get clicking on

  • 0

I am completly new to android programming and I try to get clicking on an android widget working:

public class MyWidget extends AppWidgetProvider {
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
        int[] appWidgetIds) 
{
// Loop through all widgets
for(int i=0;i < appWidgetIds.length;i++) {
    int appWigedid = appWidgetIds[i];
    // Create an intent to launce something
    Intent intent = new Intent(context,TestActivity.class);
    PendingIntent pendingintent = PendingIntent.getActivity(context, 0, intent, 0);


    // Get the layout for the app widget and attach on click listener
    RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.initial_layout);
    views.setOnClickPendingIntent(R.id.UselessMessage, pendingintent);
    views.setTextViewText(R.id.UselessMessage,"This text is useless");
    AppWidgetManager manager = AppWidgetManager.getInstance(context);
    manager.updateAppWidget(appWigedid,views);
}
}

my TestActivity class is just a stub because still trying to find out how it is called.

public class TestActivity extends Activity {
@Override
protected void onStart() {
    System.out.println("On Start called!");
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    System.out.println("on create called!");
};

}

The setting of the Text works. But the onStart method of the TestAcitivity is never executed (other sysout messages work). When I tap on the widget android logs:

12-25 17:17:43.054  1279  1392 I ActivityManager: Starting activity: Intent { flg=0x10000000 cmp=org.rfc1149.android.simple/.TestActivity bnds=[120,272][360,371] }

which would suggest that the activity is created but the onCreate does not work.

  • 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-18T20:20:51+00:00Added an answer on May 18, 2026 at 8:20 pm

    Make sure your TestActivity is defined in your manifest.

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

Sidebar

Related Questions

I am completly new to android programming and I try to get clicking on
I'm completely new to Eclipse/Java/Android programming, so this might sound like a dumb question,
A new question about android and services. Currently I'm developing a App that should
I'm completely new to Android development, but I just got a HTC Hero and
I am completely new to android, and pretty much a Java newb. I have
I'm new to Eclipse/Android development so I'm hoping this is something basic that I'm
I'm new to Eclipse/Java/Android I have already created this project, but I wanted to
I am a bit new to Android. What I need to do is send
I have read that it will allow creating an Android app without (much) programming
im trying to port an iphone app to android. i am completely new to

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.