mudit..
10
试试这段代码:
String str = "\u00F6";
System.out.println("new value-" + str);
你会得到:
new value-ö
这是我为检查功能而创建的示例android项目:
Java文件:
package com.testd;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class Main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String str = "\u00F6";
TextView tv = (TextView) findViewById(R.id.a);
tv.setText("sajklasdklfjasdf " + str );
}
}
XML文件:
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_height="wrap_content" android:text="@string/hello" />
屏幕截图: