【问题标题】:how to display logcat in text view in the other page?如何在其他页面的文本视图中显示 logcat?
【发布时间】:2014-11-25 19:32:42
【问题描述】:

我在这里有疑问。如何在其他页面的文本视图中显示日志猫? 下面是日志猫的代码。

try.java

                Log.e("MENU A","Total Price: RM "+price);

price 是双精度类型... 我应该怎么做才能在另一页的文本视图中显示价格? 现在我只能在eclipse页面底部的log cat中显示总价。 我应该声明新的文本视图吗?

我想在名为 testing.xml 的页面中显示价格。 try.java 是 testing.xml 的进程页面

请帮帮我....

【问题讨论】:

  • 使用 putExtra 和 getExtra 将变量值传递给重定向的类
  • 怎么样?你能给我举个例子吗?

标签: java android eclipse logging text


【解决方案1】:

查看有关开始另一项活动的开发人员培训网站。

http://developer.android.com/training/basics/firstapp/starting-activity.html

/** Called when the user clicks the Send button */
public void sendMessage(View view) {
    Intent intent = new Intent(this, DisplayMessageActivity.class);
    EditText editText = (EditText) findViewById(R.id.edit_message);
    String message = editText.getText().toString();
    intent.putExtra(EXTRA_MESSAGE, message);
    startActivity(intent);
}

【讨论】:

    猜你喜欢
    • 2015-02-25
    • 2019-05-12
    • 2012-05-20
    • 1970-01-01
    • 2023-03-20
    • 2019-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多