我希望通过使用此library来连接我的Android应用程序!
我收到一条异常消息:执行此代码时“Item可能不为null”:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btn=(Button)findViewById(R.id.button);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
String bot_auth="this is just an example ";
SlackSession session = SlackSessionFactory.createWebSocketSlackSession(bot_auth);
session.connect();
}
catch(Exception e){
Toast.makeText(getApplicationContext(),"error :"+e.getMessage(),Toast.LENGTH_LONG).show();
}
}
});
}