`
ppjava
  • 浏览: 135494 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Android 代码生成界面Sample

 
阅读更多

package com.example;

import com.example.hyptest.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;

public class TestActivity extends Activity {
	

	void test() {
		 final LinearLayout layout = new LinearLayout(this);
         // layout.setOrientation(LinearLayout.VERTICAL);

         Button button = new Button(this);

         button.setText("Click Me");

         button.setLayoutParams(new LinearLayout.LayoutParams(
                         LinearLayout.LayoutParams.FILL_PARENT,
                         LinearLayout.LayoutParams.WRAP_CONTENT));
         
         button.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				// Starting Another Activity
				Intent intent = new Intent(TestActivity.this , T2Activity.class);
			    //EditText editText = (EditText) findViewById(R.id.edit_message);
			    //String message = editText.getText().toString();
			    //intent.putExtra(EXTRA_MESSAGE, "abcc");
			    startActivity(intent);
			}        	 
         });                

         layout.addView(button);
         setContentView(layout);
	}

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        test();

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_hyp_test, menu);
        return true;
    }
}
 
分享到:
评论
1 楼 atgoingguoat 2014-04-21  
关注下!!!!!

相关推荐

    Android代码-sample-googleassistant

    This sample shows how to call the Google Assistant Service from Android Things using gRPC. It records a spoken request from the connected microphones, sends it to the Google Assistant API and plays ...

    Android代码-PhysicsLayout Sample

    Android layout that simulates physics using JBox2D. Simply add views, enable physics, and watch them fall! The gif is choppy, see it in action with the sample app: Gradle Dependency Add this in your ...

    Android代码-Android-MVP-Sample-Application

    Android MVP Sample Application A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP. Check out Mindorks awesome open source projects ...

    Android代码-生成Mp4电影,有滤镜,可缩放和旋转Mp4。

    Sample VideoNo filter GlGlayScaleFilter apply GlMonochromeFilter apply GlWatermarkFilter apply Gradle Step 1. Add the JitPack repository to your build file allprojects { repositories { ... ...

    Android代码-poly-sample-android

    Poly API - Android Sample Copyright (c) 2017 Google Inc. All rights reserved. This is a sample project showing how to invoke the Poly API from an Android app. Note about rendering: The focus of this ...

    Android代码-android-mvi-sample

    android-mvi-sample Example MVI implementation, based off of Google's architectural samples. Description This is a sample implementation of the Model View Intent pattern. Full Android examples for MVI...

    Android代码-Goro Sample

    A set of Android tools that facilitate apps development Well, this repo contains pretty much code used internally at Stanfy to develop Android apps. Some parts lack documentation and are outdated, we...

    Android代码-WScratchView Sample

    Android-WScratchView [Deprecated] PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED, YOU ARE WELCOME TO COPY AND IMPROVE AS YOUR OWN PROJECT. PLEASE INFORM ME THE IMPROVED VERSION SO I CAN LINK ...

    android 欢迎界面 sample LOGO 动画

    Android应用程序欢迎界面实现 经常使用到一些程序,因为开始的时候需要加载一些资料,或者是为了打下提示商标。往往都会在程序开始的时候加入欢迎界面。实现方法有很多种,今天就来说一下比较简单的方法吧。就是默认...

    编译原理实验 语义分析与中间代码生成 

    编译原理实验 语义分析与中间代码生成 Sample语言的语义和代码生成规则,熟悉Sample语言的语义分析和代码生成过

    android 多屏显示sample代码

    android 多屏显示sample代码, 能够把程序显示在不同的屏幕项目

    Android代码-sample-of-Android-week-view

    This is a sample of android week view,Thanks the author of android week view ,The WeekHeaderView is based on android week view .This project contains two view ,the header view and day view.You can add...

    Android代码-android-mvvm-sample-app

    A basic sample android application to understand MVVM in a very simple way. The app has following packages: data: It contains all the data accessing and manipulating components. ui: View classes ...

    android-19 sample

    android-19 sample

    Android代码-sample-code-github

    Its purpose being, to quickly demonstrate Android, Kotlin and software development in general. More so and amongst others, the main focus of this project is: Setup and Gradle configuration, Gradle ...

    Android代码-android-samples

    Google Maps Android API v2 Samples ... This sample demonstrates the basic setup required for a gradle-based Android Studio project. Tutorials: Samples associated with tutorials in the develop

    Android代码-Spring Layout Sample

    You can find the sample app on Google Play, just click on the logo below. How to build Simply update your gradle dependencies. build.gradle: dependencies { (...) compile('org.coderoller:...

    android developer官网例子threadSample.zip

    android developer->training->sending operations to multiple threads 的例子。demo的例子叫threadSample.zip。这个例子请结合官网文档看,对android多线程处理给出了一个解决方案,写的相当好。

    Android代码-一个 Sample Project,收集了很多移动端跨平台技术。

    "mobile times 3", Android, iOS, and Windows Phone. (todo, windows phone support) Learning Mobile C Slack instance! UIKonf 2014 CppCon 2014 - A Deep Dive Into Two Cross-Platform Mobile Apps Written in...

Global site tag (gtag.js) - Google Analytics