-
-
Save codixil/bff8b105544f032d7c263e98cfa72fa2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" | |
tools:context=".FirstActivity"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="מסך 1" | |
android:textSize="30sp" /> | |
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" | |
tools:context=".SecondActivity"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="מסך 2" | |
android:textSize="30sp" /> | |
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" | |
tools:context=".ThirdActivity"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="מסך 3" | |
android:textSize="30sp" /> | |
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.codix.app; | |
import androidx.annotation.NonNull; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
public class FirstActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_first); | |
} | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
menu.add("מעבר למסך 2"); | |
menu.add("מעבר למסך 3"); | |
return super.onCreateOptionsMenu(menu); | |
} | |
@Override | |
public boolean onOptionsItemSelected(@NonNull MenuItem item) { | |
if (item.getTitle().equals("מעבר למסך 2")) | |
startActivity(new Intent(getApplicationContext(), SecondActivity.class)); | |
else if (item.getTitle().equals("מעבר למסך 3")) | |
startActivity(new Intent(getApplicationContext(), ThirdActivity.class)); | |
return super.onOptionsItemSelected(item); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.codix.app; | |
import androidx.annotation.NonNull; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
public class SecondActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_second); | |
} | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
menu.add("מעבר למסך 1"); | |
menu.add("מעבר למסך 3"); | |
return super.onCreateOptionsMenu(menu); | |
} | |
@Override | |
public boolean onOptionsItemSelected(@NonNull MenuItem item) { | |
if (item.getTitle().equals("מעבר למסך 1")) | |
startActivity(new Intent(getApplicationContext(), FirstActivity.class)); | |
else if (item.getTitle().equals("מעבר למסך 3")) | |
startActivity(new Intent(getApplicationContext(), ThirdActivity.class)); | |
return super.onOptionsItemSelected(item); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.codix.app; | |
import androidx.annotation.NonNull; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
public class ThirdActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_third); | |
} | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
menu.add("מעבר למסך 1"); | |
menu.add("מעבר למסך 2"); | |
return super.onCreateOptionsMenu(menu); | |
} | |
@Override | |
public boolean onOptionsItemSelected(@NonNull MenuItem item) { | |
if (item.getTitle().equals("מעבר למסך 1")) | |
startActivity(new Intent(getApplicationContext(), FirstActivity.class)); | |
else if (item.getTitle().equals("מעבר למסך 2")) | |
startActivity(new Intent(getApplicationContext(), SecondActivity.class)); | |
return super.onOptionsItemSelected(item); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment