0
我使用MonoDroid的,我想开始具有我不想使用intent.putextra或任何束启动活动与参数
例如,这是我的活动性参数的新活动
namespace BoostITAndroid
{
[Activity(Label = "My Activity")]
public partial class UploadDealership : ListActivity
{
private List<Dealership> listDealers;
private Vehiclestoupload ul;
private int selectedDealershipID = 0;
private String[] Options;
public UploadDealership(Vehiclestoupload uploadList, List<Dealership> listOfDealers)
{
this.ul = uploadList;
this.listDealers = listOfDealers;
}
所以这个活动有两个参数。
下面我试图启动活动
Intent uld = new Intent(this, typeof(UploadDealership(this, listOfDealers)));
StartActivity(uld);
但是,一切都被红色下划线所以这行不通。
如何使用参数启动活动?
你可以提供一个单用私有构造和公共'得到(上下文CTX)'这要么返回一个新的项目列表或当前项目已经创建。然后,您可以从任何活动或片段传递任何东西来访问它。 – ChiefTwoPencils
你有没有例子? –
也许您正在寻找使用首选项? http://stackoverflow.com/questions/13762032/shared-preferences-in-mono-android –