1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-04-24 15:51:24 +00:00

refactored StreamingService interface so it acts as a Factory (returning new instances of called classes, eg Extractor), rather than passing Class objects (which loses type safety) which are then instantiated. Also noticed there is a conflict between existing gradle setup and mine: misc.xml and app.iml have had their jvm version values switched from 1.8 to 1.7

This commit is contained in:
Adam Howard
2015-11-02 15:03:11 +00:00
parent f67158a2a7
commit db0508b9ab
13 changed files with 56 additions and 50 deletions

View File

@@ -29,6 +29,7 @@ import android.widget.Toast;
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
/***/
public class VideoItemDetailActivity extends AppCompatActivity {
private static final String TAG = VideoItemDetailActivity.class.toString();
@@ -69,7 +70,7 @@ public class VideoItemDetailActivity extends AppCompatActivity {
try {
currentStreamingService = i;
extractor = (Extractor) ServiceList.getService(i)
.getExtractorClass().newInstance();
.getExtractorInstance();
} catch (Exception e) {
e.printStackTrace();
}
@@ -123,9 +124,9 @@ public class VideoItemDetailActivity extends AppCompatActivity {
// activity, the Up button is shown. Use NavUtils to allow users
// to navigate up one level in the application structure. For
// more details, see the Navigation pattern on Android Design:
//
// http://developer.android.com/design/patterns/navigation.html#up-vs-back
//
Intent intent = new Intent(this, VideoItemListActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
NavUtils.navigateUpTo(this, intent);