how to check data is either video or image in android? -


i using intent picking image or video gallery in android app.

i using following code

string filetypestring = "image/* video/*"; intent selectfileintent = new intent(intent.action_pick, mediastore.images.media.external_content_uri);     selectfileintent.settype(filetypestring); startactivityforresult(selectfileintent, uploadimageasynctask.media_picker); 

now how can find result either image or video?

edit: uploadimageasynctask.media_picker request code have generated elsewhere.

call below method parameter of filepath.

public string getmimetype(string filepath) {         string type = null;         string extension = getfileextensionfromurl(filepath);         if (extension != null) {             mimetypemap mime = mimetypemap.getsingleton();             type = mime.getmimetypefromextension(extension);         }         return type; } 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -