如何在其他页面的文本视图中显示logcat?

时间:2014-10-01 02:33:51

标签: java android eclipse logging text

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

try.java

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

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

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

请帮助我......

1 个答案:

答案 0 :(得分:0)

查看开发者培训网站,了解有关开展其他活动的信息。

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);
}