Add this to your layout XML:
<TextView
android:id="@+id/fileNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
and then in your Java code (if part of an Activity
context) instead of the Toast
logic:
TextView fileNameTextView = ((TextView)findViewById(R.id.fileNameTextView);
fileNameTextView.setText(file.getAbsolutePath());