package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "sublime_text.tar.bz2")) w.Header().Add("Content-Type", "application/octet-stream") http.ServeFile(w, r, "/home/steven/sublime_text.tar.bz2") }) err := http.ListenAndServe(":8090", nil) if err != nil { fmt.Println(err) } }
public class MainActivity extends Activity { ActionBar actionBar; //声明ActionBar @Override protected void onCreate( Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView( R .layout.activity_main); actionBar = getSupportActionBar(); //得 到ActionBar actionBar.hide(); //隐藏ActionBar } }
评论
发表评论