package de.danoeh.antennapod.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import de.danoeh.antennapod.core.preferences.UserPreferences;

/** Lets the user start the OPML-import process. */
public class OpmlImportFromIntentActivity extends OpmlImportBaseActivity {

    private static final String TAG = "OpmlImportFromIntentAct";

    @Override
	protected void onCreate(Bundle savedInstanceState) {
		setTheme(UserPreferences.getTheme());
		super.onCreate(savedInstanceState);

		getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        Uri uri = getIntent().getData();
        if(uri != null) {
            if(uri.toString().startsWith("/")) {
                uri = Uri.parse("file://" + uri.toString());
            }
        } else {
            uri = getIntent().getStringExtra(Intent.EXTRA_TEXT);
        }
        importUri(uri);
    }

    @Override
    protected boolean finishWhenCanceled() {
        return true;
    }

}

@@ -181,16 +181,19 @@
 es;%0A%0A/**
+%0A *
  Lets th
@@ -229,16 +229,17 @@
 process.
+%0A
  */%0Apubl
@@ -390,17 +390,20 @@
 verride%0A
-%09
+    
 protecte
@@ -447,18 +447,24 @@
 tate) %7B%0A
-%09%09
+        
 setTheme
@@ -493,18 +493,24 @@
 eme());%0A
-%09%09
+        
 super.on
@@ -542,10 +542,16 @@
 );%0A%0A
-%09%09
+        
 getS
@@ -649,24 +649,25 @@
 ;%0A        if
+ 
 (uri != null
@@ -670,27 +670,12 @@
 null
-) %7B%0A            if(
+ && 
 uri.
@@ -700,28 +700,24 @@
 ith(%22/%22)) %7B%0A
-    
             
@@ -765,22 +765,8 @@
 ));%0A
-            %7D%0A
     
@@ -792,24 +792,34 @@
       uri = 
+Uri.parse(
 getIntent().
@@ -851,16 +851,17 @@
 RA_TEXT)
+)
 ;%0A      

Convert string to uri