I need to get the full history of the user on Android for image attachment.
I tried that on Android 8.1.0(API27).
private Context o_context = null;
private ClipboardManager o_clipboardManager = null;
private ContentResolver o_contentResolver = null;
private ClipData o_clipData = null;
private void getClipboardHistory() {
o_clipboardManager = (ClipboardManager)
getSystemService(Context.CLIPBOARD_SERVICE);
o_contentResolver = getContentResolver();
o_clipData = o_clipboardManager.getPrimaryClip();
for(int i = 0; i < o_clipData.getItemCount(); i++){
ClipData.Item lo_item = o_clipData.getItemAt(i);
String ls_text = null;
String ls_title = null;
Uri lo_uri = lo_item.getUri();
}
}
I wanted to bring all the clipboards.
but o_clipData
has only one text item in this code
Perhaps that is the last data copied.
left text is clipboard and right text is removeAll