Android Open Source - gizmooi Toast Show Activity






From Project

Back to project page gizmooi.

License

The source code is released under:

GNU General Public License

If you think the Android project gizmooi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.timvdalen.gizmooi;
/*  ww w.j  av  a2  s . co m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

/**
 * Shows a Toast then closes.
 * 
 * I'd rather not actually start an Activity for this, it feels quite hacky, but there is no other way to handle click events from a widget at this point.
 * Maybe I'll change this to a detail view of the Photo with attribution info.
 */
public class ToastShowActivity extends Activity{
  @Override
  public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    
    // Get data from click Intent
    Intent intent = getIntent();
    Photo photo = (Photo) intent.getSerializableExtra("photo");
    
    // Show the attribution data
    String txtToast = photo.getTitle() + " / " + photo.getOwner() + " - " + photo.getLicense();
    
    Toast.makeText(getBaseContext(), txtToast, Toast.LENGTH_SHORT).show();
    
    finish();
  }
}




Java Source Code List

com.timvdalen.gizmooi.FlickrAPIHandler.java
com.timvdalen.gizmooi.GizmooiWidgetProvider.java
com.timvdalen.gizmooi.License.java
com.timvdalen.gizmooi.PhotoLoaderRunnable.java
com.timvdalen.gizmooi.Photo.java
com.timvdalen.gizmooi.ToastShowActivity.java