- Forum posts: 1
Jan 6, 2016, 7:40:32 AM via Website
Jan 6, 2016 7:40:32 AM via Website
Hi Devs ,
I was searching and searching for the simple activity which is just opening the stored xls using code.
What i did us i converted DB values in excel to print out , My code nicely created the excel in mentioned path but i need to open it and show also.
I am using this code. once excel is constructed ,
File file = new File(Environment.getExternalStorageDirectory().toString() + "/test.xls");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.ms-excel");
startActivity(intent);
But the newly created excel is not opening .
I think this is very usual activity. Am i overlooking it ? any simple way of doing it ?
Please help , I stuck with this for 3 days.
Thanks a lot