Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  This file is part of Roboject
  Copyright (c) 2010-2011 akquinet A.G.
  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 See the License for the specific language governing permissions and
 limitations under the License.
 public class RobojectSupportFragment extends Fragment implements RobojectLifecycleServiceConnection {
     private Container container;
     public void onActivityCreated(Bundle savedInstanceState) {

Contract for subclasses: You need to call super before relying on injections in onCreate(android.os.Bundle).
     public void onCreate(Bundle savedInstanceState) {
     public void onResume() {
     public void onStop() {
     public void onServicesConnected() {
     public void onReady() {

Attaches an arbitrary object to an android.content.Intent. This works like an intent extra, but does not require the object to be serializable or parcellable. The object is injected to the activity matching the intent, if that activity uses a matching annotation.

intent the intent matching the target activity to which we want to pass the object
key an arbitrary String used as the intent extra key
     protected void putObjectIntentExtra(Intent intentString keyObject value) {
     public void onServiceConnected(ComponentName nameIBinder serviceObject) {
     public void onServiceDisconnected(ComponentName name) {
    private void onSetContentView() {
    private void createContainer() {
        if (this. == null) {
            try {
                // Both the Android Support Library and ActionbarSherlock define
                // getActivity() inside Fragment, but with different return types
                // (FragmentActivity vs. Activity).
                // That's why we call the method by reflection and cast the result to Activity.
                Method getActivity = getClass().getMethod("getActivity"new Class[0]);
                Object activity = getActivity.invoke(thisnew Object[0]);
                if (!(activity instanceof Activity)) {
                    throw new RuntimeException("getActivity() returned null");
                this. = new Container((ActivityactivitythisgetClass());
            } catch (Exception e) {
                throw new RuntimeException(e);
New to GrepCode? Check out our FAQ X