我是安卓新手。。
我正在将一个字符串数组列表值复制到另一个字符串数组列表,我想要复制而不重复。请任何人帮助我...
非常感谢..
public class Videoplayer extends Activity { private GridView girGridView; public static String hs = ""; public static ArrayList<String> Array = new ArrayList<String>(); public static ArrayList<String> resim_list=new ArrayList<String>(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_videoplayer); Bundle bundle = getIntent().getExtras(); ArrayList<String> Array = bundle.getStringArrayList("string-array"); GridViewConfig.addImageUrls(); System.out.println("String Video"+ Array); girGridView=(GridView) findViewById(R.id.gridView1_bir); girGridView.setAdapter(new ImageAdapter(this)); girGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View view, int position,long arg3) { Toast.makeText(getApplicationContext(), GridViewConfig.getResim_list().get(position), Toast.LENGTH_SHORT).show(); } }); } public static class GridViewConfig { public static ArrayList<String> resim_list=new ArrayList<String>(); public static ArrayList<String> getResim_list() { return resim_list; } public void setResim_list(ArrayList<String> resim_list) { GridViewConfig.resim_list = resim_list; } public static void addImageUrls() { Set<String> hs = new LinkedHashSet<String>(Array);// set of unique elments // LinkedHashSet maintains insertion order resim_list.addAll(hs); System.out.println("NEW RESIM_LIST" + resim_list);
这该怎么做???