Java 类android.app.ListActivity 实例源码
项目:OpenMobster
文件:HomeScreen.java
/**
* Displays a 'List' of 'Demo Beans'
*/
private void showList(ListActivity listApp)
{
//Reads the synchronized/locally stored demo beans from the 'offlineapp_demochannel' channel on the device
MobileBean[] demoBeans = MobileBean.readAll("offlineapp_demochannel");
//Shows these beans in a List
if(demoBeans != null && demoBeans.length >0)
{
String[] ui = new String[demoBeans.length];
for(int i=0,size=ui.length;i<size;i++)
{
ui[i] = demoBeans[i].getValue("demoString");
}
listApp.setListAdapter(new ArrayAdapter(listApp,
android.R.layout.simple_list_item_1,
ui));
//List Listener
ListItemClickListener clickListener = new ClickListener(demoBeans);
NavigationContext.getInstance().addClickListener(clickListener);
}
}
项目:ringcode-android
文件:AssignmentAdapter.java
/**
* <p>Constructor: Instantiate a new adapter.</p>
* @param parent ListActivity - associated list view
* @param cur Cursor - associate managed database query
*/
public AssignmentAdapter (ListActivity parent, Cursor cur) {
super (
parent, R.layout.list_item, cur,
// columns for item display
new String[] {
Repository.NumberCode.NUMBER,
Repository.NumberCode.NAME,
Repository.NumberCode.CODE
},
// associated view elements (identifiers)
new int[] {
R.id.txt_number,
R.id.txt_name,
R.id.txt_code
}
);
}
项目:aptoide-backup-apps
文件:MultiChoiceAdapterHelper.java
void checkActivity() {
Context context = adapterView.getContext();
if (context instanceof ListActivity) {
throw new RuntimeException("ListView cannot belong to an activity which subclasses ListActivity");
}
if (context instanceof SherlockActivity || context instanceof SherlockFragmentActivity
|| context instanceof SherlockPreferenceActivity) {
return;
}
throw new RuntimeException("ListView must belong to an activity which subclasses SherlockActivity");
}
项目:OpenMobster
文件:HomeScreen.java
@Override
/**
* Invoked by the MVC runtime once the screen is rendered. This callback allows the screen setup the business state of the screen
* and update the UI to show this information
*/
public void postRender()
{
//Gets the currently active 'Activity' instance
ListActivity listApp = (ListActivity)Services.getInstance().getCurrentActivity();
//Gets the 'Cloud' configuration
AppResources res = Services.getInstance().getResources();
Configuration configuration = Configuration.getInstance(listApp);
//Check to see if the 'Demo Beans' are synchronized from the 'Cloud'. If not, a 'Boot Sync' is issued.
if(configuration.isActive() && !MobileBean.isBooted("offlineapp_demochannel"))
{
//Boots up the 'Demo Bean' sync channel
CommandContext commandContext = new CommandContext();
commandContext.setTarget("/channel/bootup/helper");
Services.getInstance().getCommandService().execute(commandContext);
return;
}
//Show the List of "Demo Beans" synchronized from the 'Cloud'.
this.showList(listApp);
//Setup the App Menu
this.setMenuItems();
}
项目:truth-android
文件:ListActivitySubject.java
public static SubjectFactory<ListActivitySubject, ListActivity> type() {
return new SubjectFactory<ListActivitySubject, ListActivity>() {
@Override
public ListActivitySubject getSubject(FailureStrategy fs, ListActivity that) {
return new ListActivitySubject(fs, that);
}
};
}
项目:incubator-wave-android
文件:TestMainActivity.java
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
DataItem item = (DataItem) mListView.getItemAtPosition(position);
// if navigation is supported, open the next activity
if (item.getNavigationInfo() != DataSource.NO_NAVIGATION) {
Intent intent = new Intent(this, ListActivity.class);
intent.putExtra(TYPE, item.getNavigationInfo());
startActivity(intent);
}
}
项目:Redpin
文件:LocationCursorAdapter.java
/**
*
* @param activity
* {@link ListActivity} that uses this CursorAdapter
* @param uri
* {@link Uri} of the {@link Location}s to be displayed
*/
public LocationCursorAdapter(ListActivity activity, Uri uri) {
super(activity, R.layout.list_row, activity.managedQuery(uri, null,
null, null, null),
new String[]{RedpinContract.Location.SYMBOLIC_ID},
new int[]{R.id.list_row_label});
this.activity = activity;
this.uri = uri;
setStringConversionColumn(getCursor().getColumnIndex(
RedpinContract.Location.SYMBOLIC_ID));
}
项目:Redpin
文件:MapCursorAdapter.java
/**
*
* @param activity
* {@link ListActivity} that uses this CursorAdapter
* @param uri
* {@link Uri} of the {@link Map}s to be displayed
*/
public MapCursorAdapter(ListActivity activity, Uri uri) {
super(activity, R.layout.list_row, activity.managedQuery(uri, null,
null, null, null), new String[]{RedpinContract.Map.NAME},
new int[]{R.id.list_row_label});
this.activity = activity;
this.uri = uri;
setStringConversionColumn(getCursor().getColumnIndex(
RedpinContract.Map.NAME));
}
项目:ApkLauncher
文件:ReflectUtil.java
public static void onListItemClick(
ListActivity activity, ListView l, View v,
int position, long id) {
try {
Method m = ListActivity.class.getDeclaredMethod("onListItemClick", new Class[]{ListView.class, View.class, int.class, long.class});
m.setAccessible(true);
m.invoke(activity, new Object[]{new Object[]{l, v, position, id}});
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("error in onListItemClick", e);
}
}
项目:android-wave
文件:TestMainActivity.java
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
DataItem item = (DataItem) mListView.getItemAtPosition(position);
// if navigation is supported, open the next activity
if (item.getNavigationInfo() != DataSource.NO_NAVIGATION) {
Intent intent = new Intent(this, ListActivity.class);
intent.putExtra(TYPE, item.getNavigationInfo());
startActivity(intent);
}
}
项目:Studentenportal
文件:GradeListActivity.java
public GradeListAdapter(ListActivity context, List<Note> list) {
super(context, list, R.layout.grade_list_item);
mGradeColors = new int[] {
getResources().getColor(R.color.grade_1),
getResources().getColor(R.color.grade_2),
getResources().getColor(R.color.grade_3),
getResources().getColor(R.color.grade_4),
getResources().getColor(R.color.grade_5)
};
}
项目:android-shared
文件:CheckableAdapterHelper.java
private void ensureActivity() {
final Context context = adapterView.getContext();
if (context instanceof ListActivity) {
throw new RuntimeException("ListView cannot belong to an activity which subclasses ListActivity");
}
if (context instanceof ActionBarActivity) {
return;
}
throw new RuntimeException("ListView must belong to an activity which subclasses SherlockActivity");
}
项目:routable-android
文件:RouterTest.java
public void test_basic() {
Router router = new Router();
router.map("users/:user_id", ListActivity.class);
Intent intent = router.intentFor("users/4");
Assert.assertEquals("4", intent.getExtras().getString("user_id"));
}
项目:routable-android
文件:RouterTest.java
public void test_empty() {
Router router = new Router();
router.map("users", ListActivity.class);
Intent intent = router.intentFor("users");
Assert.assertNull(intent.getExtras());
}
项目:routable-android
文件:RouterTest.java
public void test_url_starting_with_slash() {
Router router = new Router();
router.map("/users", ListActivity.class);
Intent intent = router.intentFor("/users");
Assert.assertNull(intent.getExtras());
}
项目:routable-android
文件:RouterTest.java
public void test_url_querystring() {
Router router = new Router();
router.map("/users/:id", ListActivity.class);
Intent intent = router.intentFor("/users/123?key1=val2");
Bundle extras = intent.getExtras();
Assert.assertEquals("123", extras.getString("id"));
Assert.assertEquals("val2", extras.getString("key1"));
}
项目:routable-android
文件:RouterTest.java
public void test_url_containing_spaces() {
Router router = new Router();
router.map("/path+entry/:id", ListActivity.class);
Intent intent = router.intentFor("/path+entry/123");
Bundle extras = intent.getExtras();
Assert.assertEquals("123", extras.getString("id"));
}
项目:routable-android
文件:RouterTest.java
public void test_url_querystring_with_encoded_value() {
Router router = new Router();
router.map("/users/:id", ListActivity.class);
Intent intent = router.intentFor("/users/123?key1=val+1&key2=val%202");
Bundle extras = intent.getExtras();
Assert.assertEquals("val 1", extras.getString("key1"));
Assert.assertEquals("val 2", extras.getString("key2"));
}
项目:routable-android
文件:RouterTest.java
public void test_url_querystring_without_value() {
Router router = new Router();
router.map("/users/:id", ListActivity.class);
Intent intent = router.intentFor("/users/123?val1");
Bundle extras = intent.getExtras();
Assert.assertTrue(extras.containsKey("val1"));
}
项目:routable-android
文件:RouterTest.java
public void test_url_starting_with_slash_with_params() {
Router router = new Router();
router.map("/users/:user_id", ListActivity.class);
Intent intent = router.intentFor("/users/4");
Assert.assertEquals("4", intent.getExtras().getString("user_id"));
}
项目:cwac-masterdetail
文件:MasterDetailHelper.java
void setListAdapter(ListAdapter adapter) {
if (host instanceof ListActivity) {
((ListActivity)host).setListAdapter(adapter);
}
else {
lv.setAdapter(adapter);
}
}
项目:GTFSOffline
文件:TimesArrayAdapter.java
public TimesArrayAdapter(ListActivity context, int layout,
boolean ampm, ArrayList<String[]> details) {
super(context, layout, details);
// Log.v(TAG, "TimesArrayAdapter()");
mDetails = details;
mInflater = LayoutInflater.from(context);
mLayout = layout;
ampmflag = ampm;
}
项目:GTFSOffline
文件:ListArrayAdapter.java
public ListArrayAdapter(ListActivity context, int layout, boolean ampm, ArrayList<String[]> details) {
super(context, layout, details);
// Log.v(TAG, "TimesArrayAdapter()");
mDetails = details;
mInflater = LayoutInflater.from(context);
mLayout = layout;
ampmflag = ampm;
}
项目:androidBits
文件:FileIcons.java
public void setScaleFactor(String aNewStringVal) {
BitsThumbnailUtils.mThumbnailFilePrefix = BitsThumbnailUtils.DEFAULT_THUMBNAIL_FILE_PREFIX+aNewStringVal;
int theNewValue = (aNewStringVal!=null)?Integer.parseInt(aNewStringVal):scaleFactor;
if (scaleFactor!=theNewValue) {
boolean saveEnabled = isEnabled();
setEnabled(false);
emptyRecycleBin();
setEnabled(saveEnabled);
scaleFactor = theNewValue;
if (mAct instanceof ListActivity)
((ListActivity)mAct).getListView().invalidateViews();
}
}
项目:UPMCarte
文件:LocationCursorAdapter.java
/**
*
* @param activity
* {@link ListActivity} that uses this CursorAdapter
* @param uri
* {@link Uri} of the {@link Location}s to be displayed
*/
public LocationCursorAdapter(ListActivity activity, Uri uri) {
super(activity, R.layout.list_row, activity.managedQuery(uri, null,
null, null, null),
new String[] { RedpinContract.Location.SYMBOLIC_ID },
new int[] { R.id.list_row_label });
this.activity = activity;
this.uri = uri;
setStringConversionColumn(getCursor().getColumnIndex(
RedpinContract.Location.SYMBOLIC_ID));
}
项目:UPMCarte
文件:MapCursorAdapter.java
/**
*
* @param activity
* {@link ListActivity} that uses this CursorAdapter
* @param uri
* {@link Uri} of the {@link Map}s to be displayed
*/
public MapCursorAdapter(ListActivity activity, Uri uri) {
super(activity, R.layout.list_row, activity.managedQuery(uri, null,
null, null, null), new String[] { RedpinContract.Map.NAME },
new int[] { R.id.list_row_label });
this.activity = activity;
this.uri = uri;
setStringConversionColumn(getCursor().getColumnIndex(
RedpinContract.Map.NAME));
}
项目:SpinList
文件:LazyAdapter.java
/**
* Loading of all necessary objects: activity and user list. Getting the
* inflater.
*/
public LazyAdapter(ListActivity activity, ArrayList<String> names) {
super();
this.activity = activity;
this.names = names;
this.folks = new FbUser[this.names.size()];
layoutInflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
new FetchDataTask(this, 0).execute(new Void[]{});
}
项目:weex-3d-map
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:ZXingAndroidExt
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:PortraitZXing
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:PortraitZXing
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:PortraitZXing
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:PortraitZXing
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:weex-analyzer-android
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:weex-3d-map
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:OpenMobster
文件:ManualSyncScreen.java
public void postRender()
{
//render the list
ListActivity listApp = (ListActivity)Services.getInstance().getCurrentActivity();
final Configuration conf = Configuration.getInstance(listApp);
AppResources appResources = Services.getInstance().getResources();
listApp.setTitle("Sync");
final String[] adapterArray;
List<String> myChannels = conf.getMyChannels();
final boolean channelsFound;
if(myChannels != null && !myChannels.isEmpty())
{
channelsFound = true;
adapterArray = myChannels.toArray(new String[0]);
listApp.setListAdapter(new ArrayAdapter(listApp,
android.R.layout.simple_list_item_1,
adapterArray));
}
else
{
channelsFound = false;
adapterArray = new String[]{"There aren't any registered channels for synchronization"};
listApp.setListAdapter(new ArrayAdapter(listApp,
android.R.layout.simple_list_item_1,
adapterArray));
}
//Setup Menu
this.setupMenu();
//Add a List click listener
ListItemClickListener clickListener = new ListItemClickListener()
{
public void onClick(ListItemClickEvent clickEvent)
{
if(!channelsFound)
{
Services.getInstance().getNavigationContext().back();
return;
}
//Perform channel-oriented functions
ManualSyncScreen.this.startChannelSelect(adapterArray[clickEvent.getPosition()]);
}
};
NavigationContext.getInstance().addClickListener(clickListener);
}
项目:truth-android
文件:ListActivitySubject.java
protected ListActivitySubject(FailureStrategy failureStrategy, ListActivity subject) {
super(failureStrategy, subject);
}
项目:Weex-TestDemo
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}
项目:here-android-sdk-examples
文件:MapListView.java
MapListView(ListActivity activity) {
m_activity = activity;
initMapEngine();
}
项目:weex
文件:LoadPackagesAsyncTask.java
LoadPackagesAsyncTask(ListActivity activity) {
this.activity = activity;
}