Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to open a youtube video?  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, guys and girls, my name is Thomas, and I'm new here. I'm making an app, and I'm stuck. My app is about band Metallica, and I use Fragments.I have four fragments(About Metallica, Albums, Members and Tours).All my data are on Firebase, and I already retrieved them and all that, but my problem is with Albums.When you click on Albums a new Activity is opened and it shows Tracks of that album. My question is simple: How do I make list of Tracks clickable in order to open a Youtube video of that track?Now, I have some of the code, and I'll post it.

You don't need to go through all this code from this class. I post it just so you can see what's going on.


This is my Youtube_class. Problem is with getSupportManager(). It keeps getting red.

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.google.android.youtube.player.YouTubeInitializationResult;
import com.google.android.youtube.player.YouTubePlayer;
import com.google.android.youtube.player.YouTubePlayerSupportFragment;
import com.google.android.youtube.player.YouTubePlayerFragment;

import butterknife.BindView;
import butterknife.ButterKnife;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;




Thank you all in advance.
 
Saloon Keeper
Posts: 5235
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That method call seems to be outside of any method, and thus not valid at that point. Did you mean to include it in the init method?
 
Thomas Lance
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean this method:



If so, I followed some example on StackOverwlof. I tryied to put that method in init(), but it says that non-static method cannot be referenced from a static context. Anyway, do you know how to solve my problem?
 
Thomas Lance
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My mistake. It's ok now. But my main problem is to set my lvTrack clickable in order to open a yt video of song that you clicked on.
Can you help me with that?
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!