Click here to Skip to main content
15,921,989 members
Home / Discussions / Android
   

Android

 
QuestionHow to resize layouts by swiping up and down Pin
jasonalien1-Jun-16 6:45
jasonalien1-Jun-16 6:45 
AnswerRe: How to resize layouts by swiping up and down Pin
Richard MacCutchan1-Jun-16 7:11
mveRichard MacCutchan1-Jun-16 7:11 
GeneralRe: How to resize layouts by swiping up and down Pin
jasonalien1-Jun-16 7:25
jasonalien1-Jun-16 7:25 
GeneralRe: How to resize layouts by swiping up and down Pin
Richard MacCutchan1-Jun-16 21:03
mveRichard MacCutchan1-Jun-16 21:03 
GeneralRe: How to resize layouts by swiping up and down Pin
jasonalien1-Jun-16 22:19
jasonalien1-Jun-16 22:19 
QuestionRe: How to resize layouts by swiping up and down Pin
David Crow2-Jun-16 4:28
David Crow2-Jun-16 4:28 
QuestionOnkeyDown Event in Xamarin Forms Pin
Srinivas Soodula31-May-16 2:06
Srinivas Soodula31-May-16 2:06 
QuestionGet error when passing data using Intent Pin
tan87325-May-16 21:15
tan87325-May-16 21:15 
Any problem for my coding? Please help, thanks.
XML
xml code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.user.myapplication.MyActivity">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/button_send"
        android:layout_gravity="center_horizontal"
        android:id="@+id/btnsubmit"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

    <EditText
        android:layout_width="100dp"
        android:layout_height="45dp"
        android:text="key in here"
        android:id="@+id/medittext" />

</RelativeLayout>
Java
MyActivity.java
package com.example.user.myapplication;

import android.app.Activity ;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import static com.example.user.myapplication.R.*;

public class MyActivity extends Activity implements View.OnClickListener {
    EditText mtext;
    Button mbutton;

    <a href="http://www.codeproject.com/Members/OverRide">@Override</a>
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(layout.activity_my);

        mtext   = (EditText)findViewById(id.medittext);
        mbutton = (Button)findViewById(id.btnsubmit);
        mbutton.setOnClickListener(this);
    }

    <a href="http://www.codeproject.com/Members/OverRide">@Override</a>
    public void onClick(View v) {
        // Do something in response to button
        Intent intent = new Intent(this, ViewActivity.class);
        String message = mtext.getText().toString();
        intent.putExtra("mtext",message);
        startActivity(intent);

    }
}

Java
ViewActivity.java
package com.example.user.myapplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
/**
 * Created by User on 22/05/2016.
 */
public class ViewActivity extends Activity{
    TextView tview;

    <a href="http://www.codeproject.com/Members/OverRide">@Override</a>
    protected void onCreate(Bundle saveInstancestate) {
        super.onCreate(saveInstancestate);
        setContentView(R.layout.view);

        tview = (TextView)findViewById(R.id.tvView);
        Intent intent = getIntent();

        String abc = intent.getStringExtra("abc");

        tview.setText(abc);
    }
}


modified 31-May-16 11:13am.

SuggestionRe: Get error when passing data using Intent Pin
Richard Deeming26-May-16 2:08
mveRichard Deeming26-May-16 2:08 
QuestionRe: Get error when passing data using Intent Pin
David Crow26-May-16 4:29
David Crow26-May-16 4:29 
QuestionSharing...not sure what it is called Pin
Mike885522-Apr-16 5:11
Mike885522-Apr-16 5:11 
AnswerRe: Sharing...not sure what it is called Pin
David Crow22-Apr-16 18:20
David Crow22-Apr-16 18:20 
GeneralRe: Sharing...not sure what it is called Pin
Mike885523-Apr-16 19:22
Mike885523-Apr-16 19:22 
GeneralRe: Sharing...not sure what it is called Pin
Mike885523-Apr-16 22:21
Mike885523-Apr-16 22:21 
SuggestionRe: Sharing...not sure what it is called Pin
David Crow24-Apr-16 16:19
David Crow24-Apr-16 16:19 
GeneralRe: Sharing...not sure what it is called Pin
Mike885524-Apr-16 17:51
Mike885524-Apr-16 17:51 
QuestionRegarding android app Pin
Member 1247467320-Apr-16 18:32
Member 1247467320-Apr-16 18:32 
AnswerRe: Regarding android app Pin
Richard MacCutchan20-Apr-16 21:18
mveRichard MacCutchan20-Apr-16 21:18 
AnswerRe: Regarding android app Pin
David Crow21-Apr-16 3:43
David Crow21-Apr-16 3:43 
AnswerRe: Regarding android app Pin
bee__bee22-Apr-16 0:29
bee__bee22-Apr-16 0:29 
QuestionWhy "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Member 1247457620-Apr-16 17:57
Member 1247457620-Apr-16 17:57 
QuestionRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Richard MacCutchan20-Apr-16 21:16
mveRichard MacCutchan20-Apr-16 21:16 
AnswerRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Member 1247457620-Apr-16 22:22
Member 1247457620-Apr-16 22:22 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Richard MacCutchan20-Apr-16 22:33
mveRichard MacCutchan20-Apr-16 22:33 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
luisvaldez27-Jan-17 2:19
luisvaldez27-Jan-17 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.