[Solved] Get integer value from edittext And Access value on Button

Declare the ed_text and mViewPager in your onCreate like this final EditText ed_text =(EditText)findViewById(R.id.editText1); final ExtendedViewPager mViewPager = (ExtendedViewPager) findViewById(R.id.view_pager); and now you can access the ed_text value in the bt_Goto click listener like this bt_Goto.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(ed_text.getText().toString().length() > 0){ mViewPager.setCurrentItem(Integer.parseInt( ed_text.getText().toString())); } } }); 1 solved Get … Read more

[Solved] How make addition of two or more numbers in a single EditText?

How to get text from edittext? initialize edittext: EditText editText = findViewById(R.id.edittext); String[] editTextValues = edittext.getText().toString().split(” “); now use editTextValues like this int firstValue = Integer.parse(editTextValues[0]); int secondValue = Integer.parse(editTextValues[1]); int sum = firstValue + secondValue; solved How make addition of two or more numbers in a single EditText?

[Solved] Why my Firebase Realtime Database is only saving 1 user [closed]

Firebase allows to store information of multiple users in firebase realtime database but only as authenticated users. I think you have not signout from your first user. That is why, its saving only one user. Have you created a signout button and have you done something like this : FirebaseAuth mAuth = FirebaseAuth.getInstance(); mAuth.signOut(); 9 … Read more

[Solved] How to change an Image in a button on clicking the button?

A Xamarin/C# way: var button = FindViewById<Button>(Resource.Id.myButton); button.Click += delegate { button.Text = “Some New Text”; // If your image is a Drawable button.SetBackgroundResource(Resource.Drawable.button_background); // From an asset button.Background = Drawable.CreateFromStream(Assets.Open(“button_asset.jpg”), null); // From an arbitrary path button.Background = Drawable.CreateFromPath(“/sdcard/Download/downloaded_file.jpg”); }; Update: If you are using drawableLeft, drawableRight, etc… in your layout, you can change … Read more

[Solved] How to show a dropdown type of menu on tap of button? [closed]

*<Button android:textAllCaps=”false” android:id=”@+id/topic_spinner” android:layout_weight=”1″ android:layout_width=”0dp” android:layout_height=”wrap_content” android:gravity=”left|center_vertical” android:background=”@android:drawable/btn_dropdown” android:singleLine=”true” android:text=”Choose a topic” android:textSize=”20dp” > </Button> Button topic_spinner; topic_spinner.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { final String[] items = new String[]{“Topic1”, “Topic2”, “Topic3”}; ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items); new AlertDialog.Builder(getActivity()).setTitle(“The Topic”).setAdapter(adapter, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { … Read more

[Solved] Why we need to implement certain methods when we extend classes in android? [closed]

They are abstract classes/methods and need to be overridden. You can choose to override the functionality or just let it do what the parent classs is doing. An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. An … Read more

[Solved] Edittext in mathview

You can not Edit the MathView with that library as per I know. As there are no proper Android libraries to display math, your requirement will be achieved if you are moving to jQuery and javascript by using webView. for reference, please visit: MathSolver solved Edittext in mathview

[Solved] Passing JSON to new activity – Android app [duplicate]

Thank you all for the answers. This has helped me understand how to use intents and I was able to solve my problem with this: Activity 1 String json= textViewResult.getText().toString(); Intent i = new Intent(Activity1.this, Activity2.class); i.putExtra(“Data”,json); startActivity(i); Activity 2 Bundle b = getIntent().getExtras(); String json = b.getString(“Data”); TextView jData = (TextView) findViewById(R.id.textView1); jData.setText(json); solved … Read more

[Solved] android place a textview over application title

Please try with the below one. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); if ( customTitleSupported ) { getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle); } final TextView myTitleText = (TextView) findViewById(R.id.myTitle); if ( myTitleText != null ) { myTitleText.setText(“MY TITLE”); } } 1 solved android place a textview over application title

[Solved] Simple sharing text and number App(Client-side) over internet [closed]

There are multiple ways to approach this problem (REST, WebSocket, etc.) I recommend using sockets in this case but I’ll leave it up to you to read up on the pros/cons of different approaches. Socket.IO has a popular Android library for real-time bidirectional event-based communication between two nodes. At a high level, to use Socket.IO … Read more