Background color when item selected blue by default.
URI item click was not correct.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:orientation="vertical"
- android:background="?android:attr/activatedBackgroundIndicator">
+ android:orientation="vertical">
<!-- Icon shown next to the title/text -->
<ImageView
android:layout_alignParentLeft="true"
android:padding="3dp"
android:orientation="vertical"
- android:contentDescription="@string/desc"/>
+ android:contentDescription="@string/desc"
+ android:background="?android:attr/activatedBackgroundIndicator"/>
<!-- Title of the ads entry -->
<TextView
color = Color.BLACK;
colorText = Color.GRAY;
}
+
view.setBackgroundColor(color);
// Setting the text view
// Setting image view
viewHolder.imageView.setImageBitmap(entry.getIcon());
- viewHolder.imageView.setBackgroundColor(Color.BLACK);
return view;
public class MobiAdsLatestList extends ListActivity implements LoaderManager.LoaderCallbacks<List<AdsEntry>>
{
- AdsEntryAdapter mAdapter;
+ AdsEntryLatestAdapter mAdapter;
@Override
public void onResume() {
super.onResume();
- mAdapter = new AdsEntryAdapter(this, R.layout.ads_entry_list_item);
+ mAdapter = new AdsEntryLatestAdapter(this, R.layout.ads_entry_list_item);
setListAdapter(mAdapter);
getListView().setTextFilterEnabled(true);
//Change notification (if there is one)
Intent updateDatabase = new Intent("de.android.mobiads.MOBIADSRECEIVER");
-
sendBroadcast(updateDatabase);
Uri uri = Uri.parse(mAdapter.getItem(position).getURL());
startActivity(new Intent(Intent.ACTION_VIEW, uri));
- //Hopefully this will update our view showing a nice black background for this item in our list :/
+ //This will update our view showing a nice black background for this item in our list :/
mAdapter.notifyDataSetChanged();
}
});
@Override
public void onDestroyActionMode(ActionMode mode) {
- //TODO: Save state (checked items) in order to keep them when coming back from
- //the home screen.
+ //Nothing to do here.
}
@Override
//Change notification (if there is one)
Intent updateDatabase = new Intent("de.android.mobiads.MOBIADSRECEIVER");
-
getActivity().sendBroadcast(updateDatabase);
//Going to open the web navigator whatever it is...
Uri uri = Uri.parse(entry.getURL());
startActivity(new Intent(Intent.ACTION_VIEW, uri));
- //Hopefully this will update our view showing a nice black background for this item in our list :/
+ //This will update our view showing a nice black background for this item in our list :/
mAdapter.notifyDataSetChanged();
}
getActivity().getContentResolver().delete(uriDelete, null, null);
mAdapter.remove(entry);
+
+ //Change notification (if there is one)
+ Intent updateDatabase = new Intent("de.android.mobiads.MOBIADSRECEIVER");
+ getActivity().sendBroadcast(updateDatabase);
+
mAdapter.notifyDataSetChanged();
}