How to place cursor position at the EditText?

Hey,
Sometimes EditText’s cursor has really stupid attitude and we need to make a static position for itself :)

Starting Point :

EditText editText = findViewById(R.id.editText);
editText.setSelection(0); // Starting point Cursor

End Point :

EditText editText = findViewById(R.id.editText);
editText.setSelection(editText.getText().length()); // End point Cursor

Custom Point :

EditText editText = findViewById(R.id.editText);
editText.setSelection(3); // Custom point Cursor
.setSelection() let us where we want to put the cursor.
If you have any question, ask me :)

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...