I recently (yesterday in fact :)) started creating widgets. So my
first widget I want to create is something like:
* A 2x2 widget
* Containing 2 buttons
    * Button 1: Register current time and location
    * Button 2: Open up an activity where configuration can be
modified, registered times and location can be viewed,...

Now the problem for me is button 1. As I only try to do some
registration data (so no further user input required after pressing
the button) I would like to just show a loading bar and after wards
Toast a message to screen, or a popup if anything goes wrong.
This is what I do now:
* In my widgetProvider
Intent intent = new Intent(context, LogDataActivity.class);
PendingIntent pintent = PendingIntent.getActivity(context, 0, intent,
0);

RemoteViews views = new RemoteViews(context.getPackageName(),
R.layout.my_widget_view);
views.setOnClickPendingIntent(R.id.startButton, pintent);

* In my LogDataActivity class
    public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);

                //Do some of my stuff

                Toast.makeText(LogDataActivity.this, "Success",
Toast.LENGTH_LONG).show();

                super.finish();
        }

So what happens: I click the button, a plain black screen pops up
(Altough I did not specify a layout upon creating the activity), and
after my work is done the Toast shows up and the activity gets
'killed'.
Basically that is what I want to do except for the black screen to
show up. Is it possible not to show a screen upon creating the
activity?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to