我想从活动到另一个分享课程。我尝试了一切,到处搜索,但无法解决我的问题。最重要的是我必须使用BusinessLogic作为整个App的控制类。每个变量,方法都在其中..有人可以帮我吗?
public void ConnectSQL() {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
try {
Class.forName("net.sourceforge.jtds.jdbc.Driver");
con = DriverManager.getConnection("jdbc:jtds:sqlserver://192.168.3.10;databaseName=hungary;user=stockiduser;password=Berwin1559;loginTimeout=5;socketTimeout=5");
KapcsolatAllasKijelzes(false);
} catch (Exception e) {
KapcsolatAllasKijelzes(true);
}
}
这个方法位于我名为 BusinessLogic 的类中......这是 MainActivity 代码:
Intent intent=new Intent(this, Kiszedes.class);
intent.putExtra("bl",bl);
startActivity(intent);
Kiszedes.class 是目标活动:
BusinessLogic bl = (BusinessLogic) getIntent().getSerializableExtra("bl");
子衿沉夜
相关分类