Uploaded July 2018 | Updated September 2026, 2 weeks ago
Toolbar or Action-bar or Menu, is quite useful feature you have to take benefit from it, by creating action or menu items to do some action in your app, or you can use it for navigation and for displaying logo or your app brand.
so, in this video you'll learn about toolbar...
and at the end of this video you'll face a small issue in updating the parent activity, I've already explained that in this tutorial:
youtu.be/geql_wwXIhw
but, if you can't solve it here is the solution:
ListOfUsers.java:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.new_user:
Intent intent = new Intent(this, NewUser.class);
startActivityForResult(intent,2);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK){
if(requestCode == 1){
if(data!=null){
//mUsersAdapter.notifyDataSetChanged();
String action = data.getStringExtra("action");
if(action.equals("update")){
mUsersAdapter.notifyItemChanged(mPosition);
}else if(action.equals("delete")){
mUsersAdapter.notifyItemRemoved(mPosition);
}
}
}else if(requestCode == 2){
mUsersAdapter.notifyItemInserted(mUsers.size());
}
}
}
========================================
NewUser.java:
mAdd_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setResult(RESULT_OK,null);
User user = new User();
user.setFirstname(mFirstname_editTxt.getText().toString());
user.setEmail(mEmail_editTxt.getText().toString());
UsersBase.get().newUser(user);
Toast.makeText(NewUser.this,"New user has been added to the list",
Toast.LENGTH_LONG).show();
mFirstname_editTxt.setText("");
mEmail_editTxt.setText("");
}
});
Toolbar or Action-bar or Menu, is quite useful feature you have to take benefit from it, by creating action or menu items to do some action in your app, or you can use it for navigation and for displaying logo or your app brand.
so, in this video you'll learn about toolbar...
and at the end of this video you'll face a small issue in updating the parent activity, I've already explained that in this tutorial:
youtu.be/geql_wwXIhw
but, if you can't solve it here is the solution:
ListOfUsers.java:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.new_user:
Intent intent = new Intent(this, NewUser.class);
startActivityForResult(intent,2);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK){
if(requestCode == 1){
if(data!=null){
//mUsersAdapter.notifyDataSetChanged();
String action = data.getStringExtra("action");
if(action.equals("update")){
mUsersAdapter.notifyItemChanged(mPosition);
}else if(action.equals("delete")){
mUsersAdapter.notifyItemRemoved(mPosition);
}
}
}else if(requestCode == 2){
mUsersAdapter.notifyItemInserted(mUsers.size());
}
}
}
========================================
NewUser.java:
mAdd_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setResult(RESULT_OK,null);
User user = new User();
user.setFirstname(mFirstname_editTxt.getText().toString());
user.setEmail(mEmail_editTxt.getText().toString());
UsersBase.get().newUser(user);
Toast.makeText(NewUser.this,"New user has been added to the list",
Toast.LENGTH_LONG).show();
mFirstname_editTxt.setText("");
mEmail_editTxt.setText("");
}
});
![How to Transfer Files From PC to iPhone - iPad - iPod (Without iTunes)!
Please watch the updated version of this method:
https://youtu.be/3Wnx5FD2yK4
Transfer files[ videos | pdf | music | movies ] from PC | Mac to iPhone, iPad without iTunes
DISCLAIMER: This Channel DOES NOT Promote or encourage Any illegal activities ,
all contents provided by This Channel is meant for EDUCATIONAL PURPOSE only .
Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for fair use
for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted
by copyright statute that might otherwise be infringing.
Non-profit, educational or personal use tips the balance in favor of fair use.
Subscribe for more:
https://goo.gl/oL45FT
SWE.Safaa Al-Hayali - saf3al2a
TAGS: #Transfer_Videos_From_PC_or_Mac_to_iPhone_without_iTunes How to Transfer Files From PC to iPhone - iPad - iPod (Without iTunes)!](https://i.ytimg.com/vi/TrFnETrojzM/mqdefault.jpg)









