Skip to content

Commit

Permalink
update how Sugar OOM is setup and called
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Oct 30, 2017
1 parent d0ee22a commit eff9b90
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
android:value="phoneypot.db" />
<meta-data
android:name="VERSION"
android:value="2" />
android:value="3" />
<meta-data
android:name="QUERY_LOG"
android:value="true" />
Expand Down
33 changes: 17 additions & 16 deletions src/main/java/info/guardianproject/phoneypot/ListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,29 +134,30 @@ public void onClick(View v) {
} else {
recyclerView.setVisibility(View.VISIBLE);
findViewById(R.id.empty_view).setVisibility(View.GONE);
}

try {
events = Event.listAll(Event.class, "id DESC");
adapter = new EventAdapter(ListActivity.this, events);
recyclerView.setAdapter(adapter);
try {
events = Event.listAll(Event.class, "id DESC");
adapter = new EventAdapter(ListActivity.this, events);
recyclerView.setAdapter(adapter);


adapter.SetOnItemClickListener(new EventAdapter.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
adapter.SetOnItemClickListener(new EventAdapter.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {

Intent i = new Intent(ListActivity.this, EventActivity.class);
i.putExtra("eventid", events.get(position).getId());
modifyPos = position;
Intent i = new Intent(ListActivity.this, EventActivity.class);
i.putExtra("eventid", events.get(position).getId());
modifyPos = position;

startActivity(i);
}
});
} catch (SQLiteException sqe) {
Log.d(getClass().getName(), "database not yet initiatied", sqe);
}
startActivity(i);
}
});
} catch (SQLiteException sqe) {
Log.d(getClass().getName(), "database not yet initiatied", sqe);
}


}

private void deleteEvent (final Event event, final int position)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package info.guardianproject.phoneypot;

import android.app.Application;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.orm.SugarApp;
import com.orm.SugarContext;

/**
* Created by n8fr8 on 8/9/17.
*/

public class PhoneyPotApp extends SugarApp {
public class PhoneyPotApp extends Application {

@Override
public void onCreate() {
super.onCreate();

Fresco.initialize(this);
SugarContext.init(this);
}
}

0 comments on commit eff9b90

Please sign in to comment.