ArrayAdapter notifyDataSetChanged - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ArrayAdapter notifyDataSetChanged method.

This code example shows how to use the following methods:add, notifyDataSetChanged
        bookmarks = (ListView)findViewById(R.id.bookmarks);
        bookmarks.setAdapter(adapter);
    } 
 
    public void addBookmark(View v) {
        adapter.add(url.getText().toString());
        adapter.notifyDataSetChanged();
 
        url.setText("");
    } 
 
    // ... rest of class ... 
 
    // END:edits 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true; 
    } 
    // START:edits 
6
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
	} 
 
	protected void notifyDataSetChanged() { 
		ListAdapter listAdapter = getListAdapter();
    	if (listAdapter!=null && listAdapter instanceof ArrayAdapter) {
    		((ArrayAdapter<?>)listAdapter).notifyDataSetChanged();
    	} else { 
    		Log.w(TAG, "Could not update list Array Adapter");
    	} 
	} 
 
	@Override 
	public boolean isIntegrateWithHistoryManager() { 
		return commonActivityBase.isIntegrateWithHistoryManager();
	} 
	@Override 
	public void setIntegrateWithHistoryManager(boolean integrateWithHistoryManager) {
		commonActivityBase.setIntegrateWithHistoryManager(integrateWithHistoryManager);
	} 
 
6
CodeRank
This code example shows how to use the following methods:add, notifyDataSetChanged
            { 
                final ArrayAdapter<String> adapter = (ArrayAdapter) listView.getAdapter();
 
//                listView.setLayoutAnimation(AnimationUtils.loadLayoutAnimation(ListAnimation.this, R.anim.layout_animation_table)); 
                final ArrayAdapter adapter1 = (ArrayAdapter) listView.getAdapter();
                adapter1.add(Long.toString(System.currentTimeMillis()));
                adapter1.notifyDataSetChanged();
            } 
        }); 
    } 
 
    public static void callMe(Context c)
    { 
        c.startActivity(new Intent(c, ListAnimation.class));
    } 
} 
5
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
	} 
	 
	@Override 
	public void onStart() { 
		super.onStart(); 
        setListAdapter(spaceAdapter);
        getListView().setOnItemClickListener(this);
         
        //END 
        spaceAdapter.notifyDataSetChanged();
	} 
	 
	public void setOnSpaceSelectedListener(SpaceSelectedListener listener) {
		this.listener = listener;
	} 
	 
	public interface SpaceSelectedListener { 
		public void onSpaceSelected(int position);
	} 
 
5
CodeRank
This code example shows how to use the following methods:add, notifyDataSetChanged
	private void processChatData(String device, String name, String msg) {
		if (conversation_map.containsKey(device)) {
			Log.d(TAG, "Device found: " + device);
			ArrayAdapter<String> chatAdapter = conversation_map.get(device);
			Log.d(TAG, "chatAdapter:" + chatAdapter);
			chatAdapter.add(name + ": " + msg);
			chatAdapter.notifyDataSetChanged();
		} else { 
			adapter.addDevice(device, name, msg);
			adapter.notifyDataSetChanged();
		} 
	} 
 
	private void processMsgData(String device, String name, String msg) {
		addMsgToInbox(name,msg);
		setNotificationForMsg("New message from: " + name, name, msg);
	} 
 
	private void addMsgToInbox(String name, String msg) {
		Log.d(TAG,"Adding SMS to inbox.");
5
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
		finish();
	} 
 
	// METHOD WHICH WILL HANDLE DYNAMIC INSERTION 
	public void addItems(View v) {
		adapter.notifyDataSetChanged();
	} 
} 
5
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
	} 
	 
	private void removeItem(int index) {
		if(index > -1) {
			todoItems.remove(index);
			todoItemsArrayAdapter.notifyDataSetChanged();
		} 
	} 
	 
} 
4
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
		 
		if (requestCode == RQS_LOADIMAGE){
			if (resultCode == RESULT_OK) {
			 Uri imageUri = data.getData();
			 arrayUri.add(imageUri);
			 myFileListAdapter.notifyDataSetChanged();
			 Toast.makeText(getApplicationContext(), "Photo Added", Toast.LENGTH_LONG).show();
			} 
		} 
		if (requestCode == RQS_SENDEMAIL){
			Toast.makeText(getApplicationContext(), "Email Send", Toast.LENGTH_LONG).show();
		} 
		 
	} 
 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present. 
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true; 
4
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
		return null; 
	} 
 
	@Override 
	protected void onProgressUpdate(Void... progress) {
		mRemoteArrayAdapter.notifyDataSetChanged();
	} 
	 
	@Override 
	protected void onPostExecute(Void result) {
		mScanBtn.setClickable(true);
		mScanBtn.setText(string.scan);
	} 
} 
4
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
					   String Path = pathList.get(pos);
	    	           switch (which) {
	    	           case 0: 
	    	        	  final  File file = new File(Path);
	    	        	   boolean deleted = file.delete();
	    	        	   setListAdapter(directoryList);
	        	           ListDir(SDDIR);
	        	           directoryList.notifyDataSetChanged();
	        	           if (deleted == true) {
	        	        	   Toast.makeText(getApplicationContext(), "File deleted succesfully", Toast.LENGTH_SHORT);
	        	           }else{ 
	        	        	   Toast.makeText(getApplicationContext(), "There was a problem while deleting the selected file", Toast.LENGTH_SHORT);
	        	           } 
	    	        	   break; 
	    	           case 1: 
	    	        	    AlertDialog.Builder alert = new AlertDialog.Builder(getfiles.this);                 
	    	        	    alert.setTitle("Rename File");  
	    	        	    alert.setMessage("Enter new file name");                
 
	    	        	     // Set an EditText view to get user input    
5
CodeRank

Related ArrayAdapter notifyDataSetChanged Questions & Answers:

notifyDataSetChanged Method Overview
Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself.
See Code Examples for other Android ArrayAdapter Methods: