當前位置: 首頁>>代碼示例>>Java>>正文


Java ListActivity類代碼示例

本文整理匯總了Java中android.app.ListActivity的典型用法代碼示例。如果您正苦於以下問題:Java ListActivity類的具體用法?Java ListActivity怎麽用?Java ListActivity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ListActivity類屬於android.app包,在下文中一共展示了ListActivity類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showList

import android.app.ListActivity; //導入依賴的package包/類
/**
 * 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);
	}
}
 
開發者ID:ZalemSoftware,項目名稱:OpenMobster,代碼行數:26,代碼來源:HomeScreen.java

示例2: AssignmentAdapter

import android.app.ListActivity; //導入依賴的package包/類
/**
 * <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
		}
	);
}
 
開發者ID:bfix,項目名稱:ringcode-android,代碼行數:23,代碼來源:AssignmentAdapter.java

示例3: checkActivity

import android.app.ListActivity; //導入依賴的package包/類
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");
}
 
開發者ID:Aptoide,項目名稱:aptoide-backup-apps,代碼行數:12,代碼來源:MultiChoiceAdapterHelper.java

示例4: postRender

import android.app.ListActivity; //導入依賴的package包/類
@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();
}
 
開發者ID:ZalemSoftware,項目名稱:OpenMobster,代碼行數:32,代碼來源:HomeScreen.java

示例5: type

import android.app.ListActivity; //導入依賴的package包/類
public static SubjectFactory<ListActivitySubject, ListActivity> type() {
  return new SubjectFactory<ListActivitySubject, ListActivity>() {
    @Override
    public ListActivitySubject getSubject(FailureStrategy fs, ListActivity that) {
      return new ListActivitySubject(fs, that);
    }
  };
}
 
開發者ID:pkware,項目名稱:truth-android,代碼行數:9,代碼來源:ListActivitySubject.java

示例6: onItemClick

import android.app.ListActivity; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:apache,項目名稱:incubator-wave-android,代碼行數:12,代碼來源:TestMainActivity.java

示例7: LocationCursorAdapter

import android.app.ListActivity; //導入依賴的package包/類
/**
 *
 * @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));
}
 
開發者ID:MaKeAppDev,項目名稱:Redpin,代碼行數:20,代碼來源:LocationCursorAdapter.java

示例8: MapCursorAdapter

import android.app.ListActivity; //導入依賴的package包/類
/**
 *
 * @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));

}
 
開發者ID:MaKeAppDev,項目名稱:Redpin,代碼行數:20,代碼來源:MapCursorAdapter.java

示例9: onListItemClick

import android.app.ListActivity; //導入依賴的package包/類
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);
	}
}
 
開發者ID:luoqii,項目名稱:ApkLauncher,代碼行數:13,代碼來源:ReflectUtil.java

示例10: GradeListAdapter

import android.app.ListActivity; //導入依賴的package包/類
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)
          };
}
 
開發者ID:protyposis,項目名稱:Studentenportal,代碼行數:11,代碼來源:GradeListActivity.java

示例11: ensureActivity

import android.app.ListActivity; //導入依賴的package包/類
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");
}
 
開發者ID:remelpugh,項目名稱:android-shared,代碼行數:14,代碼來源:CheckableAdapterHelper.java

示例12: test_basic

import android.app.ListActivity; //導入依賴的package包/類
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"));
}
 
開發者ID:clayallsopp,項目名稱:routable-android,代碼行數:8,代碼來源:RouterTest.java

示例13: test_empty

import android.app.ListActivity; //導入依賴的package包/類
public void test_empty() {
	Router router = new Router();
	router.map("users", ListActivity.class);

	Intent intent = router.intentFor("users");
	Assert.assertNull(intent.getExtras());
}
 
開發者ID:clayallsopp,項目名稱:routable-android,代碼行數:8,代碼來源:RouterTest.java

示例14: test_url_starting_with_slash

import android.app.ListActivity; //導入依賴的package包/類
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());
}
 
開發者ID:clayallsopp,項目名稱:routable-android,代碼行數:8,代碼來源:RouterTest.java

示例15: test_url_querystring

import android.app.ListActivity; //導入依賴的package包/類
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"));
}
 
開發者ID:clayallsopp,項目名稱:routable-android,代碼行數:11,代碼來源:RouterTest.java


注:本文中的android.app.ListActivity類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。