刚开始学习android,请问android怎么更改activity的的标题栏的默认的icon的图片?

推荐图书

  • Android 2高级编程(第2版)
  • Google Android SDK开发范例大全(第2版)
  • 疯狂Android讲义


1个回答

package com.example.text01;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
public class Test01 extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_LEFT_ICON);

        setContentView(R.layout.main);

        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.qq);
    }
}