当前位置: 首页>>代码示例>>Java>>正文


Java Activity.toString方法代码示例

本文整理汇总了Java中android.app.Activity.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.toString方法的具体用法?Java Activity.toString怎么用?Java Activity.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.Activity的用法示例。


在下文中一共展示了Activity.toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public void onAttach(Activity activity) {
	super.onAttach(activity);
	if (activity instanceof OnFragmentInteractionListener) {
		mListener = (OnFragmentInteractionListener) activity;
	} else {
		throw new RuntimeException(activity.toString()
				+ " must implement OnFragmentInteractionListener");
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:AbstractFragment.java

示例2: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {
        serverAdapterListCallbacks = (ServerAdapterListCallbacks) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement ServerAdapterListCallbacks");
    }
}
 
开发者ID:rootkiwi,项目名称:an2linuxclient,代码行数:11,代码来源:ServerDialog.java

示例3: onAttach

import android.app.Activity; //导入方法依赖的package包/类
/** onAttach 在 fragment 第一次被联系到它的 activity 上时被调用 */
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    // 确保父 activity 实现回调接口,如果没实现,抛出异常
    try {
        mCallback = (OnHeadlineSelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement OnHeadlineSelectedListener");
    }
}
 
开发者ID:lavenderming,项目名称:Google-Android-Developer,代码行数:14,代码来源:HeadlinesFragment.java

示例4: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    // Verify that the host activity implements the callback interface
    try {
        // Instantiate the NoticeDialogListener so we can send events to the host
        mListener = (NoticeDialogListener) activity;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(activity.toString()
                + " must implement NoticeDialogListener");
    }
}
 
开发者ID:kartik2112,项目名称:TDList,代码行数:14,代码来源:CalendarDialogBoxFragment.java

示例5: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    try {
        conversationFragmentCallbackListener = (ConversationFragmentCallbackListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement ConversationFragmentCallbackListener");
    }
}
 
开发者ID:mobilemaster128,项目名称:quickblox-android,代码行数:12,代码来源:BaseConversationFragment.java

示例6: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    try {
        incomeCallFragmentCallbackListener = (IncomeCallFragmentCallbackListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement OnCallEventsController");
    }
}
 
开发者ID:mobilemaster128,项目名称:quickblox-android,代码行数:12,代码来源:IncomeCallFragment.java

示例7: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    // Verify that the host activity implements the callback interface
    try {
        // Instantiate the SendChallengeDialogListener so we can sendMessage events to the host
        listener = (SendScheduleDialogListener) activity;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(activity.toString()
                + " must implement SendScheduleDialogListener");
    }
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:14,代码来源:RequestScheduleDialogFragment.java

示例8: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {
        mRetryTokenListener = (RetryTokenListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement RetryTokenListener");
    }
}
 
开发者ID:YunzhanghuOpen,项目名称:redpacketui-open,代码行数:10,代码来源:SendPacketBaseFragment.java

示例9: onAttach

import android.app.Activity; //导入方法依赖的package包/类
/**
 * This will make sure that {@link OnDeviceSelectedListener} interface is implemented by activity.
 */
@Override
public void onAttach(final Activity activity) {
	super.onAttach(activity);
	try {
		this.mListener = (OnDeviceSelectedListener) activity;
	} catch (final ClassCastException e) {
		throw new ClassCastException(activity.toString() + " must implement OnDeviceSelectedListener");
	}
}
 
开发者ID:runtimeco,项目名称:Android-DFU-App,代码行数:13,代码来源:ScannerFragment.java

示例10: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    try {
        mListener = (OnCompleteListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnCompleteListener");
    }

}
 
开发者ID:CMPUT301W17T08,项目名称:Moodr,代码行数:12,代码来源:AddStory.java

示例11: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onAttach(Activity context) {
    super.onAttach(context);
    if (context instanceof OnPlayPauseClickedListener) {
        mCallback = (OnPlayPauseClickedListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnPlayPauseClickedListener");
    }
}
 
开发者ID:cleaninsights,项目名称:cleaninsights-android-sdk,代码行数:12,代码来源:PlaybackOverlayFragment.java

示例12: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity context) {
    super.onAttach(context);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mNavigationCallback = (MainActivity) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement OnHeadlineSelectedListener");
    }
}
 
开发者ID:medialab-prado,项目名称:puremadrid,代码行数:14,代码来源:MainFragment.java

示例13: onAttach

import android.app.Activity; //导入方法依赖的package包/类
/**
 * Called when a fragment is first attached to its activity. onCreate(Bundle) will be called after this.
 *
 * @param activity
 */
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    try {
        mListener = (OnSettingsListener) activity;
        appData = new AppData(activity.getApplicationContext());
        isFullScreen = appData.getClockFullScreen();
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement OnSettingsListener");
    }
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:19,代码来源:SettingsFragment.java

示例14: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    attachedActivity = activity;
    try {
        listener = (OnFragmentInteractionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
开发者ID:Bartout-Team,项目名称:Bartout,代码行数:12,代码来源:UserFragment.java

示例15: onAttach

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mCallback = (EditBuildInfoListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement EditBuildInfoListener");
    }
}
 
开发者ID:kiwiandroiddev,项目名称:starcraft-2-build-player,代码行数:14,代码来源:EditBuildInfoFragment.java


注:本文中的android.app.Activity.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。