protected internal override void onCreate(android.os.Bundle savedInstanceState) { base.onCreate(savedInstanceState); android.os.Bundle extras = getIntent().getExtras(); if (extras == null) { finish(); return; } mNumDeletes = extras.getLong("numDeletes"); mAccount = (android.accounts.Account)extras.getParcelable("account"); mAuthority = extras.getString("authority"); mProvider = extras.getString("provider"); // the order of these must match up with the constants for position used in onItemClick java.lang.CharSequence[] options = new java.lang.CharSequence[] { getResources(). getText([email protected][email protected]_really_delete), getResources().getText( [email protected][email protected]_undo_deletes), getResources().getText([email protected] [email protected]_do_nothing) }; android.widget.ListAdapter adapter = new android.widget.ArrayAdapter<java.lang.CharSequence >(this, android.R.layout.simple_list_item_1, android.R.id.text1, options); android.widget.ListView listView = new android.widget.ListView(this); listView.setAdapter(adapter); listView.setItemsCanFocus(true); listView.setOnItemClickListener(this); android.widget.TextView textView = new android.widget.TextView(this); java.lang.CharSequence tooManyDeletesDescFormat = getResources().getText([email protected] [email protected]_too_many_deletes_desc); textView.setText(java.lang.CharSequenceProxy.Wrap(string.Format(tooManyDeletesDescFormat .ToString(), mNumDeletes, mProvider, mAccount.name))); android.widget.LinearLayout ll = new android.widget.LinearLayout(this); ll.setOrientation(android.widget.LinearLayout.VERTICAL); android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams .WRAP_CONTENT, 0); ll.addView(textView, lp); ll.addView(listView, lp); // TODO: consider displaying the icon of the account type // AuthenticatorDescription[] descs = AccountManager.get(this).getAuthenticatorTypes(); // for (AuthenticatorDescription desc : descs) { // if (desc.type.equals(mAccount.type)) { // try { // final Context authContext = createPackageContext(desc.packageName, 0); // ImageView imageView = new ImageView(this); // imageView.setImageDrawable(authContext.getResources().getDrawable(desc.iconId)); // ll.addView(imageView, lp); // } catch (PackageManager.NameNotFoundException e) { // } // break; // } // } setContentView(ll); }
public virtual android.widget.Filter getFilter() { if (mFilter == null) { mFilter = new android.widget.ArrayAdapter <T> .ArrayFilter(this); } return(mFilter); }
protected internal override void onCreate(android.os.Bundle savedInstanceState) { base.onCreate(savedInstanceState); android.os.Bundle extras = getIntent().getExtras(); if (extras == null) { finish(); return; } mNumDeletes = extras.getLong("numDeletes"); mAccount = (android.accounts.Account)extras.getParcelable("account"); mAuthority = extras.getString("authority"); mProvider = extras.getString("provider"); // the order of these must match up with the constants for position used in onItemClick java.lang.CharSequence[] options = new java.lang.CharSequence[] { getResources(). getText([email protected][email protected]_really_delete), getResources().getText( [email protected][email protected]_undo_deletes), getResources().getText([email protected] [email protected]_do_nothing) }; android.widget.ListAdapter adapter = new android.widget.ArrayAdapter <java.lang.CharSequence >(this, android.R.layout.simple_list_item_1, android.R.id.text1, options); android.widget.ListView listView = new android.widget.ListView(this); listView.setAdapter(adapter); listView.setItemsCanFocus(true); listView.setOnItemClickListener(this); android.widget.TextView textView = new android.widget.TextView(this); java.lang.CharSequence tooManyDeletesDescFormat = getResources().getText([email protected] [email protected]_too_many_deletes_desc); textView.setText(java.lang.CharSequenceProxy.Wrap(string.Format(tooManyDeletesDescFormat .ToString(), mNumDeletes, mProvider, mAccount.name))); android.widget.LinearLayout ll = new android.widget.LinearLayout(this); ll.setOrientation(android.widget.LinearLayout.VERTICAL); android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams .WRAP_CONTENT, 0); ll.addView(textView, lp); ll.addView(listView, lp); // TODO: consider displaying the icon of the account type // AuthenticatorDescription[] descs = AccountManager.get(this).getAuthenticatorTypes(); // for (AuthenticatorDescription desc : descs) { // if (desc.type.equals(mAccount.type)) { // try { // final Context authContext = createPackageContext(desc.packageName, 0); // ImageView imageView = new ImageView(this); // imageView.setImageDrawable(authContext.getResources().getDrawable(desc.iconId)); // ll.addView(imageView, lp); // } catch (PackageManager.NameNotFoundException e) { // } // break; // } // } setContentView(ll); }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_pos_printer_direct_io, container, false); view.findViewById(R.id.buttonDirectIO).OnClickListener = this; view.findViewById(R.id.buttonBatteryStatus).OnClickListener = this; dataSpinner = (Spinner)view.findViewById(R.id.spinnerData); ArrayAdapter <CharSequence> adapter = new ArrayAdapter <CharSequence>(Activity, android.R.layout.simple_spinner_item, DATA_STRING); adapter.DropDownViewResource = android.R.layout.simple_spinner_dropdown_item; dataSpinner.Adapter = adapter; deviceMessagesTextView = (TextView)view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; return(view); }
public AbsSpinner(android.content.Context context, android.util.AttributeSet attrs , int defStyle) : base(context, attrs, defStyle) { mRecycler = new android.widget.AbsSpinner.RecycleBin(this); initAbsSpinner(); android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.AbsSpinner, defStyle, 0); java.lang.CharSequence[] entries = a.getTextArray([email protected]_entries ); if (entries != null) { android.widget.ArrayAdapter <java.lang.CharSequence> adapter = new android.widget.ArrayAdapter <java.lang.CharSequence>(context, [email protected]_spinner_item , entries); adapter.setDropDownViewResource([email protected]_spinner_dropdown_item ); setAdapter(adapter); } a.recycle(); }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.main_activity; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.ListView listActivities = (android.widget.ListView) findViewById(R.id.listview); ListView listActivities = (ListView)findViewById(R.id.listview); string[] activityNames = new string[] { getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]) }; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.ArrayAdapter<String> adapter = new android.widget.ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, activityNames); ArrayAdapter <string> adapter = new ArrayAdapter <string>(this, android.R.layout.simple_list_item_1, activityNames); listActivities.Adapter = adapter; listActivities.OnItemClickListener = new OnItemClickListenerAnonymousInnerClassHelper(this); }