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

  • Home
  • SEARCH
  • 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 quite new to Android programming but familiar with C/C++ and Linux enough to
I try to follow the facebook-android tutorial from here: https://developers.facebook.com/docs/mobile/android/build/#sample I am working in
I am new on android programming, just did one app so far. After it's
I'm new to Android app programming and started to read a book, but it
I'm completely new to Eclipse/Java/Android programming, so this might sound like a dumb question,
I am rather new to Android programming in general and am having particular difficulty
I'm completely new to programming on the Android platform but I'm interested in learning
I am new to Android. I want to know what the Looper class does
I am completely new to android, and pretty much a Java newb. I have

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.