當前位置: 首頁>>代碼示例>>Java>>正文


Java Context.toString方法代碼示例

本文整理匯總了Java中android.content.Context.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java Context.toString方法的具體用法?Java Context.toString怎麽用?Java Context.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.Context的用法示例。


在下文中一共展示了Context.toString方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    if (context instanceof OnLabelSelectedListener){
        try {
            mCallback = (OnLabelSelectedListener) context;
        } catch (ClassCastException e) {
            throw new ClassCastException(context.toString()
                    + " must implement OnHeadlineSelectedListener");
        }
    }

}
 
開發者ID:danlls,項目名稱:Todule-android,代碼行數:17,代碼來源:ToduleLabelFragment.java

示例2: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnPhotoInteractionListener) {
        mListener = (OnPhotoInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnPhotoInteractionListener");
    }
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:11,代碼來源:PhotoFragment.java

示例3: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
        context = context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
開發者ID:tonyzhang617,項目名稱:tutoriah,代碼行數:12,代碼來源:IndTutoringFragment.java

示例4: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
開發者ID:Francescopaolo44,項目名稱:AndroidApp-Deploy,代碼行數:11,代碼來源:Fragment_three.java

示例5: TouchableWrapper

import android.content.Context; //導入方法依賴的package包/類
public TouchableWrapper(Context context) {
    super(context);

    try {
     //   updateMapUserClick = (MainActivity) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement UpdateMapUserClick");
    }
}
 
開發者ID:cahergil,項目名稱:Farmacias,代碼行數:10,代碼來源:TouchableWrapper.java

示例6: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof Listener) {
        this.activityCallback = (Listener) context;
    } else {
        throw new ClassCastException(context.toString()
                + " must implement Listener");
    }
}
 
開發者ID:m2049r,項目名稱:xmrwallet,代碼行數:11,代碼來源:LoginFragment.java

示例7: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {
        callback = (TimeoutListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement TimeoutListener");
    }
}
 
開發者ID:steevp,項目名稱:UpdogFarmer,代碼行數:10,代碼來源:TimeoutFragment.java

示例8: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    // Verify that the host activity implements the callback interface
    try {
        // Instantiate the NoticeDialogListener so we can send events to the host
        mListener = (NoteEditDialogListener) context;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(context.toString()
                + " must implement NoteEditDialogListener");
    }
}
 
開發者ID:ramack,項目名稱:ActivityDiary,代碼行數:14,代碼來源:NoteEditDialog.java

示例9: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnAuthorItemClickListener) {

        mListener = (OnAuthorItemClickListener) context;

    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnCategoryItemClickListener");
    }
    if (context instanceof BrowsingActivity) {
        ((BrowsingActivity) context).registerListener(this);
    }
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:16,代碼來源:AuthorListFragment.java

示例10: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {
        mListener = (SortItemsDialogListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement SortItemsDialogListener");
    }
}
 
開發者ID:mvescovo,項目名稱:item-reaper,代碼行數:11,代碼來源:SortItemsDialogFragment.java

示例11: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof MessagesFragmentInteractionListener) {
        listener = (MessagesFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement MessagesFragmentInteractionListener");
    }
}
 
開發者ID:IrrilevantHappyLlamas,項目名稱:Runnest,代碼行數:11,代碼來源:MessagesFragment.java

示例12: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof RepositoriesListFragment.OnFragmentInteractionListener) {
        mListener = (RepositoriesListFragment.OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
開發者ID:OlgaKuklina,項目名稱:GitJourney,代碼行數:11,代碼來源:RepositoriesListFragment.java

示例13: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof SearchFragmentCallback) {
        searchFragmentCallback = (SearchFragmentCallback) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement SearchFragmentCallback");
    }
}
 
開發者ID:rascarlo,項目名稱:AURdroid,代碼行數:11,代碼來源:SearchFragment.java

示例14: onAttach

import android.content.Context; //導入方法依賴的package包/類
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    mContext = context;
    try {
        mListener = (OnFragmentInteractionListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
開發者ID:uncleashi,項目名稱:find-client-android,代碼行數:12,代碼來源:TrackFragment.java


注:本文中的android.content.Context.toString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。