本文整理汇总了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();
}
}
});
}