how to get filename from the path
<p>i want to show the filename from the full path. i m getting the full path but don't know how to get that file name with extension?
please show me by some example.</p>

<p>code which i use to get full path of the file:</p>

<pre><code>if (resultCode == Activity.RESULT_OK) {
    Log.i("On onActivityResult", "get path");
    Uri selectedVideoUri = data.getData();
    try {
        String filemanagerstring = selectedVideoUri.getPath();
            String selectedVideoPath = getPath(selectedVideoUri);
        if (selectedVideoPath != null) {
        filePath = selectedVideoPath;
        Log.i("VideoFilePath", "" + filePath);
        } else if (filemanagerstring != null) {
        filePath = filemanagerstring;
        Log.i("FilePath", "" + filePath);
        } else {
            Toast.makeText(getApplicationContext(), "Unknown path",
                            Toast.LENGTH_LONG).show();
            Log.e("Bitmap", "Unknown path");
            Log.i("FilePath", "" + filePath);
        }
</code></pre>
