+ 1

I have an issue, maybe it's because a missing import.

I want to make spinner in my app that I could select item using it. so my code was: map_picker.setAdapter(new ArrayAdapter<String>(getBaseContext(), android.R.layout.simple_spinner_dropdown_item, mapsTit)); that code caused an error message: The type MainActivity.ArrayAdapter is not generic; it cannot be parameterized with arguments <String> Then I searched google. And knew that it was because of error in input! My input: no enought space here to write it!

23rd Dec 2020, 1:30 AM
Saad
Saad - avatar
10 odpowiedzi
+ 1
There is no correct answer until now.
23rd Dec 2020, 8:03 PM
Saad
Saad - avatar
+ 5
Awesome 👍👍👍Saad .
24th Dec 2020, 7:07 AM
Mohammed Qadir Khan
Mohammed Qadir Khan - avatar
+ 3
Show Your code.
24th Dec 2020, 2:58 AM
Mohammed Qadir Khan
Mohammed Qadir Khan - avatar
+ 2
I did.
24th Dec 2020, 6:58 AM
Saad
Saad - avatar
+ 1
my imports: import androidx.appcompat.app.AppCompatActivity; import androidx.annotation.*; import com.google.android.material.floatingactionbutton.FloatingActionButton; import android.app.*; import android.os.*; import android.view.*; import android.view.View.*; import android.widget.*; import android.content.*; import android.content.res.*; import android.graphics.*; import android.graphics.drawable.*; import android.media.*; import android.net.*; import android.text.*; import android.text.style.*; import android.util.*; import android.webkit.*; import android.animation.*; import android.view.animation.*; import java.util.*; import java.util.regex.*; import java.text.*; import org.json.*; import java.util.HashMap; import java.util.ArrayList; import android.widget.LinearLayout; import androidx.recyclerview.widget.*; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView.Adapter; import androidx.recyclerview.widget.RecyclerView.ViewHolder; import android.widget.ImageView; import com.google.android.material.button.*; import android.widget.Spinner; import android.widget.ArrayAdapter; import android.app.Activity; import android.content.SharedPreferences; import android.view.View; import android.widget.AdapterView; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import android.content.ClipData; import android.content.ClipboardManager; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.DialogFragment; import androidx.core.content.ContextCompat; import androidx.core.app.ActivityCompat; import android.Manifest; import android.content.pm.PackageManager;
23rd Dec 2020, 1:02 PM
Saad
Saad - avatar
+ 1
its better to do that in js
25th Dec 2020, 12:47 AM
AW4
AW4 - avatar