Quantcast
Viewing all articles
Browse latest Browse all 77050

Please help me, I appear to be a noob -_- - java.lang.reflect.InvocationTargetException

So I'm new to Xaramrin and I've picked up alot so far, but each time I debug my app and run it I get this error, I've tried google for a soultion but no luck so hopefully someone can help me.

Image may be NSFW.
Clik here to view.

Home.cs -Activity:

`[Activity (Label = "Home")]
public class Home : Activity
{

    ImageButton btnSettings;


    protected override void OnCreate (Bundle bundle)
    {
        RequestWindowFeature (WindowFeatures.ActionBar);
        base.OnCreate (bundle);

        // Set Layout
        SetContentView (Resource.Layout.Home);
        //
        InitializeControls ();
    }

    public void InitializeControls()
    {

        btnSettings = FindViewById <ImageButton> (Resource.Id.buttonMenu);
        btnSettings.Click += onBtnSettingsClick;

    }

    void onBtnSettingsClick (object sender, EventArgs e)
    {
        //Toast.MakeText (this,"It Worked!", ToastLength.Long).Show();
        // Set layout
        StartActivity(typeof(Settings));

    }`

Home.axml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff0f0f0"
    android:scrollbars="horizontal"
    android:id="@+id/linearLayout2">
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="54.3dp"
        android:id="@+id/linearLayout1"
        android:background="#ff26a69a">
        <SearchView
            android:minWidth="25px"
            android:minHeight="25px"
            android:layout_width="289.9dp"
            android:layout_height="match_parent"
            android:id="@+id/searchView1" />
        <Button
            android:id="@+id/buttonMenu"
            android:background="@drawable/menuellipsis"
            android:layout_width="71.6dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="0.0dp" />
    </LinearLayout>
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="48.4dp"
        android:id="@+id/linearLayout1"
        android:background="#ffffffff">
        <ImageButton
            android:layout_width="55.4dp"
            android:layout_height="match_parent"
            android:id="@+id/imageButtonNewsfeed"
            android:background="@drawable/menunewsfeed"
            android:layout_marginLeft="5dp" />
        <Space
            android:layout_width="15.6dp"
            android:layout_height="match_parent"
            android:id="@+id/space1" />
        <ImageButton
            android:layout_width="55.4dp"
            android:layout_height="match_parent"
            android:id="@+id/imageButtonChat"
            android:background="@drawable/menuchatgrey" />
        <Space
            android:layout_width="15.6dp"
            android:layout_height="match_parent"
            android:id="@+id/space1" />
        <ImageButton
            android:layout_width="55.4dp"
            android:layout_height="match_parent"
            android:id="@+id/imageButtonNotifications"
            android:background="@drawable/menunotegrey" />
        <Space
            android:layout_width="15.6dp"
            android:layout_height="match_parent"
            android:id="@+id/space1" />
        <ImageButton
            android:layout_width="55.4dp"
            android:layout_height="match_parent"
            android:id="@+id/imageButtonTrophy"
            android:background="@drawable/menutrophygrey" />
        <Space
            android:layout_width="15.6dp"
            android:layout_height="match_parent"
            android:id="@+id/space1" />
        <ImageButton
            android:layout_width="55.4dp"
            android:layout_height="match_parent"
            android:id="@+id/imageButtonSettings"
            android:background="@drawable/menusettingsgrey" />
    </LinearLayout>
    <Space
        android:layout_width="match_parent"
        android:layout_height="11.4dp"
        android:id="@+id/space2" />
    <FrameLayout
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="match_parent"
        android:layout_height="48.6dp"
        android:id="@+id/frameLayout1"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="5dp"
        android:background="#ff26a69a">
        <TextView
            android:text="What's new"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/textView1"
            android:layout_margin="10dp" />
    </FrameLayout>
    <EditText
        android:inputType="textMultiLine"
        android:layout_width="match_parent"
        android:layout_height="126.6dp"
        android:id="@+id/editText1"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:background="#FFF" />
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="41.7dp"
        android:id="@+id/linearLayout3"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="-10dp">
        <LinearLayout
            android:orientation="vertical"
            android:minWidth="25px"
            android:minHeight="25px"
            android:layout_width="261.8dp"
            android:layout_height="match_parent"
            android:id="@+id/linearLayout4"
            android:background="#FFF" />
        <Button
            android:text="Post"
            android:layout_width="83.8dp"
            android:layout_height="match_parent"
            android:id="@+id/button1"
            android:background="#ff26a69a" />
    </LinearLayout>
</LinearLayout>

If anyone can figure this out for me I shall be so grateful.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>