本文整理匯總了Java中cn.smssdk.gui.layout.CountryListPageLayout類的典型用法代碼示例。如果您正苦於以下問題:Java CountryListPageLayout類的具體用法?Java CountryListPageLayout怎麽用?Java CountryListPageLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CountryListPageLayout類屬於cn.smssdk.gui.layout包,在下文中一共展示了CountryListPageLayout類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: afterPrepare
import cn.smssdk.gui.layout.CountryListPageLayout; //導入依賴的package包/類
private void afterPrepare() {
runOnUIThread(new Runnable() {
public void run() {
CountryListPageLayout page = new CountryListPageLayout(activity);
LinearLayout layout = page.getLayout();
if (layout != null) {
activity.setContentView(layout);
}
if (countryRules == null || countryRules.size() <= 0) {
handler = new EventHandler() {
@SuppressWarnings("unchecked")
public void afterEvent(int event, final int result, final Object data) {
if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
runOnUIThread(new Runnable() {
public void run() {
if (pd != null && pd.isShowing()) {
pd.dismiss();
}
if (result == SMSSDK.RESULT_COMPLETE) {
onCountryListGot((ArrayList<HashMap<String,Object>>) data);
} else {
((Throwable) data).printStackTrace();
int resId = ResHelper.getStringRes(activity, "smssdk_network_error");
if (resId > 0) {
Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
}
finish();
}
}
});
}
}
};
// 注冊回調接口
SMSSDK.registerEventHandler(handler);
// 獲取國家列表
SMSSDK.getSupportedCountries();
} else {
if (pd != null && pd.isShowing()) {
pd.dismiss();
}
initPage();
}
}
});
}
示例2: afterPrepare
import cn.smssdk.gui.layout.CountryListPageLayout; //導入依賴的package包/類
private void afterPrepare() {
runOnUIThread(new Runnable() {
public void run() {
CountryListPageLayout page = new CountryListPageLayout(activity);
LinearLayout layout = page.getLayout();
if (layout != null) {
activity.setContentView(layout);
}
if (countryRules == null || countryRules.size() <= 0) {
handler = new EventHandler() {
@SuppressWarnings("unchecked")
public void afterEvent(int event, final int result, final Object data) {
if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
runOnUIThread(new Runnable() {
public void run() {
if (pd != null && pd.isShowing()) {
pd.dismiss();
}
if (result == SMSSDK.RESULT_COMPLETE) {
onCountryListGot((ArrayList<HashMap<String,Object>>) data);
} else {
((Throwable) data).printStackTrace();
int resId = getStringRes(activity, "smssdk_network_error");
if (resId > 0) {
Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
}
finish();
}
}
});
}
}
};
// 注冊回調接口
SMSSDK.registerEventHandler(handler);
// 獲取國家列表
SMSSDK.getSupportedCountries();
} else {
if (pd != null && pd.isShowing()) {
pd.dismiss();
}
initPage();
}
}
});
}