CopyPastor

Detecting plagiarism made easy.

Score: 1.8122260570526123; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2018-12-19
by Rubin bhandari

Original Post

Original - Posted on 2016-10-12
by mghhgm



            
Present in both answers; Present only in the new answer; Present only in the old answer;

1) On AndroidManifest.xml
<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
2) On xml layout you must use AutoCompleteTextView instead of EditText.
<AutoCompleteTextView android:id="@+id/autoCompleteTextView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:text="AutoCompleteTextView" />
3) Use this on Activity file
private ArrayAdapter<String> getEmailAddressAdapter(Context context) { Account[] accounts = AccountManager.get(context).getAccounts(); String[] addresses = new String[accounts.length]; for (int i = 0; i < accounts.length; i++) { addresses[i] = accounts[i].name; } return new ArrayAdapter<String>(context, android.R.layout.simple_dropdown_item_1line, addresses); }
4) On onCreate activity:
AutoCompleteTextView autoCompleteTextView1 = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1); autoCompleteTextView1.setAdapter(getEmailAddressAdapter(this));
I use this code:
[![enter image description here][1]][1]
1) On AndroidManifest.xml
<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
2) On xml layout you must use AutoCompleteTextView instead of EditText.
<AutoCompleteTextView android:id="@+id/autoCompleteTextView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:text="AutoCompleteTextView" /> 3) Use this on Activity file
private ArrayAdapter<String> getEmailAddressAdapter(Context context) { Account[] accounts = AccountManager.get(context).getAccounts(); String[] addresses = new String[accounts.length]; for (int i = 0; i < accounts.length; i++) { addresses[i] = accounts[i].name; } return new ArrayAdapter<String>(context, android.R.layout.simple_dropdown_item_1line, addresses); }
4) On onCreate activity:
AutoCompleteTextView autoCompleteTextView1 = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1); autoCompleteTextView1.setAdapter(getEmailAddressAdapter(this));

[1]: https://i.stack.imgur.com/7hgcz.jpg

        
Present in both answers; Present only in the new answer; Present only in the old answer;