0

I am seriously baffled. i am new to android development i am currently trying to use Android Studio and the scenario is this, i have a text file which contains an mp4 link that i want to play when a button is pressed in my MainActivity.

The problem is i need to read the text (the text is a single line) from url as a string and place the string in lines 21 and 29 of the picture i have added.

if i need to use a new thread then how would i do that aswell as call it from the MainActivity.

Here Is The Image of My code Inside MainActivity

Thank You

Inside 4ndroid
  • 135
  • 1
  • 10
  • http://stackoverflow.com/questions/2075836/read-contents-of-a-url-in-android and http://stackoverflow.com/questions/4328711/read-url-to-string-in-few-lines-of-java-code and http://stackoverflow.com/questions/14418021/get-text-from-web-page-to-string are some of the many Web pages that I find when I search a search engine for `android read URL into string`. Please explain what you tried and what specific problems you encountered. – CommonsWare May 06 '17 at 17:45
  • i have tried all of the above specifically i would like to use the example in http://stackoverflow.com/a/31321409/5578676 but my app force closes everytime i just dont know what i am doing wrong here is a screener of the code as i have it now.. http://i65.tinypic.com/5ur7f9.png – Inside 4ndroid May 06 '17 at 18:44
  • "my app force closes everytime" -- use LogCat to examine the Java stack trace associated with your crash: http://stackoverflow.com/questions/23353173/unfortunately-myapp-has-stopped-how-can-i-solve-this – CommonsWare May 06 '17 at 18:48
  • Thank You. i managed to get the log, now i just got to figure out what is actually.. lots of reading an new learning curve :P – Inside 4ndroid May 06 '17 at 19:12
  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a [mcve] – GhostCat May 06 '17 at 19:39

0 Answers0