I use simpleAdapter, not custom, I rename the file, simpleAdapter.notifyDataSetChanged (); do not refresh listview which is why some are checked online to custom adapter, Does this have to be a custom, it should not be it, experts hope to give pointers,
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
This thing needed is a collection class, which is not wrong. Can you paste code
Reply:
simpleAdapter to modify the contents inside, ah,
Reply:
Where are you calling notifyDataSetChanged?
Reply:
Rename the file?
Posted under your code look.
Reply:
Is not no change data ah
Reply:
Posted the code to let everyone see
Reply:
I was in when you press the OK button to call, enter the complete file name, press OK
Reply:
Data is changing, and this I'm sure
Reply:
The following code snippet is invoked
new AlertDialog.Builder (this). setTitle ("rename")
. SetView (input). SetPositiveButton ("OK", new DialogInterface.OnClickListener () {
public void onClick (DialogInterface dialog,
int which) {
String newfilename = input.getText () toString ();.
Map
File file = new File ((String) itempath.get ("filePath"));
String newFilePath = file.getParent ();
File newFile = new File (newFilePath + "/" + newfilename);
try {
if (file.renameTo (newFile)) {
listItemsPath.remove (selectedPosition);
simpleAdapter.notifyDataSetChanged ();
/ / SimpleAdapter.notifyDataSetChanged ();
}
Reply:
The following code snippet is invoked
new AlertDialog.Builder (this). setTitle ("rename")
. SetView (input). SetPositiveButton ("OK", new DialogInterface.OnClickListener () {
public void onClick (DialogInterface dialog,
int which) {
String newfilename = input.getText () toString ();.
Map
File file = new File ((String) itempath.get ("filePath"));
String newFilePath = file.getParent ();
File newFile = new File (newFilePath + "/" + newfilename);
try {
if (file.renameTo (newFile)) {
listItemsPath.remove (selectedPosition);
simpleAdapter.notifyDataSetChanged ();
/ / SimpleAdapter.notifyDataSetChanged ();
}
Reply:
Is it upstairs to earn credit
Reply:
Themselves, thank you, as well as the upstairs earn points
No comments:
Post a Comment