Move "appid" into AppDetails.EXTRA_APPID

This commit is contained in:
Daniel Martí 2014-04-10 15:49:02 +02:00
parent 2cdb634865
commit 7fd3ea236e
4 changed files with 8 additions and 5 deletions

View File

@ -74,6 +74,9 @@ public class AppDetails extends ListActivity {
private static final int REQUEST_INSTALL = 0;
private static final int REQUEST_UNINSTALL = 1;
public static final String EXTRA_APPID = "appid";
private ApkListAdapter adapter;
private static class ViewHolder {
@ -287,10 +290,10 @@ public class AppDetails extends ListActivity {
}
Log.d("FDroid", "AppDetails launched from link, for '" + appid
+ "'");
} else if (!i.hasExtra("appid")) {
} else if (!i.hasExtra(EXTRA_APPID)) {
Log.d("FDroid", "No application ID in AppDetails!?");
} else {
appid = i.getStringExtra("appid");
appid = i.getStringExtra(EXTRA_APPID);
}
if (i.hasExtra("from")) {

View File

@ -106,7 +106,7 @@ public class FDroid extends FragmentActivity {
}
if (appid != null && appid.length() > 0) {
Intent call = new Intent(this, AppDetails.class);
call.putExtra("appid", appid);
call.putExtra(AppDetails.EXTRA_APPID, appid);
startActivityForResult(call, REQUEST_APPDETAILS);
}

View File

@ -138,7 +138,7 @@ public class SearchResults extends ListActivity {
app = new App((Cursor) adapter.getItem(position));
Intent intent = new Intent(this, AppDetails.class);
intent.putExtra("appid", app.id);
intent.putExtra(AppDetails.EXTRA_APPID, app.id);
startActivityForResult(intent, REQUEST_APPDETAILS);
super.onListItemClick(l, v, position, id);
}

View File

@ -118,7 +118,7 @@ abstract public class AppListFragment extends ListFragment implements
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final App app = new App((Cursor)getListView().getItemAtPosition(position));
Intent intent = new Intent(getActivity(), AppDetails.class);
intent.putExtra("appid", app.id);
intent.putExtra(AppDetails.EXTRA_APPID, app.id);
intent.putExtra("from", getFromTitle());
startActivityForResult(intent, FDroid.REQUEST_APPDETAILS);
}