CopyPastor

Detecting plagiarism made easy.

Score: 0.8900331330334285; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2019-09-04
by Pradeep Kumar

Original Post

Original - Posted on 2019-09-04
by Pradeep Kumar



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

if you are wanna add the data in String[] arr=new String[100]; then its wrong. You can do the same work as in form of ArrayList but remember you will never put here a Getter/Setter class. Just simply declare it. See this example.
Declare in main partition:

ArrayList<String>arr=new ArrayList<>();
and then initilize it in this way:


for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject1 = (JSONObject) jsonArray.get(i); String imei = jsonObject1.getString("imei"); String name = jsonObject1.getString("name"); String my_pic = jsonObject1.getString("my_pic"); String email = jsonObject1.getString("email"); arr.add(name); } adapter= new ArrayAdapter<> (this, android.R.layout.select_dialog_item, arr); autoCompleteText.setThreshold(1);//will start working from first character autoCompleteText.setAdapter(adapter);//setting the adapter data into the AutoCompleteTextView autoCompleteText.setTextColor(Color.RED); }
I hope this will work for you....
if you are wanna add the data in String[] arr=new String[100]; then its wrong. You can do the same work as in form of ArrayList but remember you will never put here a Getter/Setter class. Just simply declare it. See this example.
Declare in main partition:
ArrayList<String>arr=new ArrayList<>();
and then initilize it in this way:

for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject1 = (JSONObject) jsonArray.get(i); String imei = jsonObject1.getString("imei"); String name = jsonObject1.getString("name"); String my_pic = jsonObject1.getString("my_pic"); String email = jsonObject1.getString("email"); arr.add(name); } adapter= new ArrayAdapter<> (this, android.R.layout.select_dialog_item, arr); autoCompleteText.setThreshold(1);//will start working from first character autoCompleteText.setAdapter(adapter);//setting the adapter data into the AutoCompleteTextView autoCompleteText.setTextColor(Color.RED); }
I hope this will work for you...

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