Android Open Source - streaming_project Media Activity






From Project

Back to project page streaming_project.

License

The source code is released under:

GNU General Public License

If you think the Android project streaming_project listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.streaming.streaming;
/*  w  w w  .ja  v a 2s.com*/

import android.support.v4.app.Fragment;


// It hosts an instance of MediaFragment
// NOTE: the intent received by MediaActivity when a user selects a media has an extra for the
// media ID
public class MediaActivity extends SingleFragmentActivity {
    /** A key for passing a media ID as a long */
    // TODO: this key refers to the _id column, not the media_id column
    public static final String EXTRA_MEDIA_ID =
            "com.example.raul.test_streaming.media_id";

    @Override
    protected Fragment createFragment() {
        // If the intent has a MEDIA_ID extra, create the MediaFragment using newInstance()
        // If not, just use the default constructor
        long mediaId = getIntent().getLongExtra(EXTRA_MEDIA_ID, -1);
        if (mediaId != -1) {
            return MediaFragment.newInstance(mediaId);
        } else {
            // TODO: this can not be executed because we have not yet implemented the feature of
            // TODO: adding a Media in the media table
            return new MediaFragment();
        }
    }
}




Java Source Code List

com.example.streaming.streaming.ApplicationTest.java
com.example.streaming.streaming.AssetsPropertyReader.java
com.example.streaming.streaming.DataFetcher.java
com.example.streaming.streaming.DataLoader.java
com.example.streaming.streaming.MainActivity.java
com.example.streaming.streaming.MediaActivity.java
com.example.streaming.streaming.MediaDatabaseHelper.java
com.example.streaming.streaming.MediaFragment.java
com.example.streaming.streaming.MediaListActivity.java
com.example.streaming.streaming.MediaListFragment.java
com.example.streaming.streaming.MediaLoader.java
com.example.streaming.streaming.MediaManager.java
com.example.streaming.streaming.MediaProvider.java
com.example.streaming.streaming.Media.java
com.example.streaming.streaming.SQLiteCursorLoader.java
com.example.streaming.streaming.SingleFragmentActivity.java