I'm making an object draggable in an App (following android developer's guide for this), and it looks like this:
ClipData dragData = new ClipData(v.getTag(), ClipData.MIMETYPE_TEXT_PLAIN, item);
But the IDE gives the following error:
Cannot resolve symbol 'MIMETYPE_TEXT_PLAIN'
So my question is this: How can I make the IDE recognize the MIMETYPE_TEXT_PLAIN?
And yes, I've tried (what seems that should be the correct way) to change ClipData.MIMETYPE_TEXT_PLAIN
to ClipDescription.MIMETYPE_TEXT_PLAIN
but that just seems to make everything worse, like you can see in the following screenshot:
You need to use type CharSequence for first and String array for second parameter.
ClipData dragData = new ClipData((CharSequence) v.getTag(),
new String[]{ ClipDescription.MIMETYPE_TEXT_PLAIN }, item);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With