Android Open Source - HandyNotes Handy Notes






From Project

Back to project page HandyNotes.

License

The source code is released under:

GNU General Public License

If you think the Android project HandyNotes 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 net.tapi.handynotes;
/* www.j ava2 s.  co m*/
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;

public class HandyNotes extends AppWidgetProvider {
    private NotesDbAdapter db;

  @Override
  public void onUpdate(Context context,
                   AppWidgetManager appWidgetManager,
                   int[] appWidgetIds) {
    
        db = new NotesDbAdapter(context);
        db.open();
    
    for (int appWidgetId : appWidgetIds) {
      RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.show_note);
      
      String text = db.showNoteText(appWidgetId);

            views.setTextViewText(R.id.showNoteText, text);
            
      Intent editIntent = new Intent(context, EditNote.class);
      editIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
      PendingIntent pendingIntent = PendingIntent.getActivity(context, appWidgetId, editIntent, 0);
      
      views.setOnClickPendingIntent(R.id.showNote, pendingIntent);

      appWidgetManager.updateAppWidget(appWidgetId, views);
    }
    
    db.close();
  }

  @Override
  public void onDeleted(Context context,
                   int[] appWidgetIds) {
    
        db = new NotesDbAdapter(context);
        db.open();
        
    for (int appWidgetId : appWidgetIds) {
      db.deleteNote(appWidgetId);
    }
        
    db.close();
  }
}




Java Source Code List

net.tapi.handynotes.EditNote.java
net.tapi.handynotes.HandyNotes11.java
net.tapi.handynotes.HandyNotes22.java
net.tapi.handynotes.HandyNotes33.java
net.tapi.handynotes.HandyNotes41.java
net.tapi.handynotes.HandyNotes42.java
net.tapi.handynotes.HandyNotes44.java
net.tapi.handynotes.HandyNotes.java
net.tapi.handynotes.NewNote.java
net.tapi.handynotes.NotesDbAdapter.java