在上传中单击我填充数组列表,填充后我想在相同的行为中查看我不想调用任何其他活动。表示在点击上传后我想添加数据并在同一活动上显示上传文件不要调用任何其他活动来查看。我不关心它的textview或任何其他视图我也可以使用任何其他视图
public void uploadfile(View view){
edittext = (EditText)findViewById(R.id.txtFile);
List<String> name = new ArrayList<String>();
List<String> number = new ArrayList<String>();
if(FullPath != null)
{
/* CSV UPLOADER */
try{
File csvfile = new File(FullPath);
FileInputStream csvStream = new FileInputStream(csvfile);
BufferedReader in = new BufferedReader(new InputStreamReader(csvStream));
String line;
String[] rowData = null;
int iCount=0;
String dataRow = in.readLine();
while (dataRow != null){
String[] RowData = dataRow.split(",");
name.add(new String(RowData[0]));
number.add(new String(RowData[1]));
dataRow = in.readLine();
iCount++;
}
in.close();
Toast.makeText(NewMessage.this, "CSV Has uploaded", 2000).show();
setContentView(R.layout.new_message);
ListViewName = (ListView) findViewById(R.id.txtCustomerName);
ListViewNumber = (ListView) findViewById(R.id.txtNumber);
}
catch(Exception e)
{
Toast.makeText(NewMessage.this, e.toString(), 2000).show();
}
/*CSV Uploader Finish*/
/*View CSV into an array*/
/*Want To view array List in textview or anything but not on the different page but on the same page*/
}
else
{
Toast.makeText(NewMessage.this, "No File Selected", 2000).show();
}
}