當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。