Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some compile error and package name is case-sensitive #32

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
getLayoutInflater().inflate(R.layout.custom_toast, mainLinearLayout, …
…false)
lutaoact committed May 8, 2015
commit 531b1db17c9502cd219c62275477526d1cf720a9
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
@@ -14,6 +15,8 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

final ViewGroup mainLinearLayout = (ViewGroup)findViewById(R.id.main_linear_layout);

Button button = (Button) findViewById(R.id.toast_button);
button.setOnClickListener(new OnClickListener() {

@@ -25,7 +28,7 @@ public void onClick(View v) {
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);

toast.setView(getLayoutInflater().inflate(R.layout.custom_toast,null));
toast.setView(getLayoutInflater().inflate(R.layout.custom_toast, mainLinearLayout, false));

toast.show();
}