当前位置: 首页>>代码示例>>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;未经允许,请勿转载。