Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8795751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:27:28+00:00 2026-06-13T23:27:28+00:00

I’m a new student on Android. I’m able to fetch an xml from website

  • 0

I’m a new student on Android. I’m able to fetch an xml from website to display text along with thumbnail in a listview. i’m able to show the item with default application. It mostly opens browser or media plyaer, But i want to show the content within application in secondary activity. It should detect type of media from tag from xml and display it on secondary activity using related module/class. I dont know how to add more activity and opening different media types internally. Below is the code i’m using now. Please guide me with keeping in mind that i’m a total newbie. Thanks in advance.

xml looks like:

<items count="1">
  <item>
     <title>This is title no 1</title>
     <description>this is description</description>
     <type>mp3, image, video</type>
     <date>date of item</date>
     <thumb>url of an thumbnail</thumb>
     <url>url to play item from</url>
  </item>
</items> 

//listview click code:

public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
 String title = ((TextView) view.findViewById(R.id.title)).getText().toString();
 String description = ((TextView) view.findViewById(R.id.desc)).getText().toString();
 String type = ((TextView) view.findViewById(R.id.type)).getText().toString();
 String cTime = ((TextView) view.findViewById(R.id.time)).getText().toString();


 Element e = (Element) nl.item(position);  //using final var to get previously declared xmls
 String imageurl = parser.getValue(e, KEY_URL);  
 startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(imageurl))); 
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:27:29+00:00Added an answer on June 13, 2026 at 11:27 pm

    First of all, you need to go through INTENT Apis….they help in switching from one activity to other…..Secondly, When you are trying to play a media file, the Android OS detects the media type and selects the available applications to play that file from your device. It automatically intents from your app to the media player.Provided you have done the parsing of the xml fine. If there are no applications present that can present your file or say, if your device does not support a particular media type(say mp4,wmv, flv etc), it will throw you an error, media cannot be played as its not supported.

    “It mostly opens browser or media plyaer, But i want to show the content within application in secondary activity”

    This is what I mentioned previously. If you want the media to play your file from your application, then probably you should write your own media player class to which you can pass the intent

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
In my XML file chapters tag has more chapter tag.i need to display chapters
I have a text area in my form which accepts all possible characters from
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.