直播源码开发,情景模式界面设计

直播源码开发,情景模式界面设计

MainActivity.java源代码

 

 

1
<br>package com.example.myring;<br>  <br>import android.media.AudioManager;<br>import android.os.Bundle;<br> <br>import android.app.AlarmManager;<br>import android.app.TabActivity;<br>import android.content.Context;<br>import android.view.LayoutInflater;<br>import android.view.Menu;<br>import android.view.View;<br>import android.view.View.OnClickListener;<br>import android.widget.ImageButton;<br>import android.widget.ImageView;<br>import android.widget.ProgressBar;<br>import android.widget.RadioGroup;<br>import android.widget.TabHost;<br>import android.widget.RadioGroup.OnCheckedChangeListener;<br>import android.widget.TabHost.OnTabChangeListener;<br>import android.widget.TimePicker;<br> <br>public class MainActivity extends TabActivity {<br>private ImageView imageView1;<br>private ImageButton imageButton1;<br>private ImageButton imageButton2;<br>private ImageButton imageButton3;<br>private ImageButton imageButton4;<br>private ImageButton imageButton5;<br>@Override<br>protected void onCreate(Bundle savedInstanceState) {<br>super.onCreate(savedInstanceState);<br>imageView1=(ImageView) this.findViewById(R.id.imageView1);<br>imageButton1=(ImageButton)this.findViewById(R.id.imageButton1);<br>imageButton2=(ImageButton)this.findViewById(R.id.imageButton2);<br>imageButton3=(ImageButton)this.findViewById(R.id.imageButton3);<br>imageButton4=(ImageButton)this.findViewById(R.id.imageButton4);<br>imageButton5=(ImageButton)this.findViewById(R.id.imageButton5);<br>final TabHost tabHost = getTabHost();<br>LayoutInflater inflater = LayoutInflater.from(this);<br>inflater.inflate(R.layout.activity_main, tabHost.getTabContentView());<br>TabHost.TabSpec tab01 = tabHost.newTabSpec("tab01")<br>.setIndicator("普通情景模式", getResources().getDrawable(R.drawable.icon))<br>.setContent(R.id.group1);<br> <br>TabHost.TabSpec tab02 = tabHost.newTabSpec("tab02")<br>.setIndicator("定时情景模式",getResources().getDrawable(R.drawable.timeprofile))<br>.setContent(R.id.second);<br>TabHost.TabSpec tab03 = tabHost.newTabSpec("tab03")<br>.setIndicator("自定义情景模式", getResources().getDrawable(R.drawable.addprofile))<br>.setContent(R.id.third);<br>//将创建好的Tab对象放入到tabHost中<br>tabHost.addTab(tab01);<br>tabHost.addTab(tab02);<br>tabHost.addTab(tab03);<br>tabHost.setCurrentTab(0);<br>tabHost.setBackgroundResource(R.drawable.bg);<br>}<br> <br> <br>    <br>  <br>  <br>@Override<br>public boolean onCreateOptionsMenu(Menu menu) {<br>// Inflate the menu; this adds items to the action bar if it is present.<br>getMenuInflater().inflate(R.menu.main, menu);<br>return true;<br>}<br> <br>} 

以上就是 直播源码开发,情景模式界面设计,更多内容欢迎关注之后的文章

 

posted @   云豹科技-苏凌霄  阅读(10)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示