【发布时间】:2014-08-30 13:03:52
【问题描述】:
在我的新项目中,我需要在 Toast 中显示 dbm。我以前从未使用过信号强度。我在互联网上搜索了很多,但我没有找到任何好的信息。在我的想象中,这应该很容易,但我无法构建可行的东西。 你能帮帮我吗?
Button btn=(Button)findViewById(R.id.start);
btn.setOnClickListener(this);
}
public void onClick(View v) {
switch (v.getId()) {
case R.id.start:
Toast.makeText(this, "signal strength is " + this.signalDBM + "dBm", Toast.LENGTH_SHORT).show();
break;
【问题讨论】:
-
那有什么问题?
-
尝试将
getApplicationContext()放在this的位置..
标签: android signal-strength dbm