Created
April 14, 2013 03:07
-
-
Save ahomu/5381242 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArticleActivity extends Activity with TypedActivity { | |
override def onCreate(savedInstanceState: Bundle) { | |
super.onCreate(savedInstanceState) | |
val details: EntryFragment = new EntryFragment() | |
details.setArguments(getIntent().getExtras()) | |
getFragmentManager().beginTransaction().add(android.R.id.content, details).commit() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EntryFragment extends Fragment { | |
override def onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View = { | |
if (container == null) { | |
return null | |
} | |
val v: View = inflater.inflate(R.layout.article, container, false) | |
val w: WebView = v.findViewById(R.id.browser).asInstanceOf[WebView] | |
w.loadUrl(getArguments().getString("url")) | |
return v | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment