[Solved] How do I show a result from Random in a textview?

You have to add a TextView to display the result. Step 1. Adding ID to TextView, in the XML file. <TextView android:id=”@+id/myId” android:layout_width=”wrap_content” android:layout_height=”wrap_content” …. /> Step 2. Finding TextView using ID, under onCreate method: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView myTextView = (TextView) findViewById(R.id.myId); } Step 3. Set the text with … Read more

[Solved] How can i play a video in full screen in another activity on clicking a card view [closed]

The question you have asked involves a larger implementation with code. Use ExoPlayer to play videos in android. You can learn it from this CodeLab and also check this for more information. From your question i understand there is a cardView and when you press it, a video show play in another activity. So for … Read more

[Solved] Custom array adapter to listview error

Try this @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(mCtx); // View view = inflater.inflate(R.layout.list_publikasi,null,true); if(converView == null) { convertView = inflater.inflate(R.layout.item_user, parent, false); } TextView textNama = (TextView) convertView.findViewById(R.id.textNama); TextView textDetail = (TextView) convertView.findViewById(R.id.textDetail); TextView textStatus = (TextView) convertView.findViewById(R.id.textStatus); TextView textPeriode = (TextView) convertView.findViewById(R.id.textPeriode); Publikasi publikasi = lstPublikasi.get(position); … Read more

[Solved] how to get sharedpreferences value in edittext from another activity in android for signin [closed]

You want to sign in using shared preferences. Follow these options 1: Get data from EditText in your signin activity. Like string username = ed1.getText().toString(); string password = ed2.getText().toString(); then get data from shared preferences username and password now compare both et if(username.equals(sharepreferencesusername) && password.equals(sharedpreferencespassword)){ goto next activity… } solved how to get sharedpreferences value … Read more

[Solved] android null pointer exception [duplicate]

Try this.Assuming the variable albumList is global. and albumList is not null; final int speedScroll = 1000; final Handler handler = new Handler(); final Runnable runnable = new Runnable() { int count = 0; @Override public void run() { if(count == albumList.size()) count =0; if(count < albumList.size()){ recyclerView4.smoothScrollToPosition(++count); handler.postDelayed(this,speedScroll); } } }; handler.postDelayed(runnable,speedScroll); } @Override … Read more

[Solved] Newbie here! How to create a detail page activity for a list view item, without including an action bar in it? Help required

I solved my problem in 3 steps: For creating detail activity page I used an adapter class to fetch all the data from server FOr no ActionBar I made a custom action bar, set it to transparent, changed my app theme by calling a Parent theme and then modified for primary, primary Dark and accent … Read more

[Solved] I am stucked at this login page

Probably your specified host is not correct. In the error message, the host is specified as “localhost/127.0.0.1”. Both localhost and 127.0.0.1 are synonymous both times your own pc. For example, change the specified host from “localhost/127.0.0.0.1” to “127.0.0.1” and it should work. solved I am stucked at this login page

[Solved] In an if/else statment, when I have the “if” body toast is displayed for empty EditText BUT when I add the else body, it does not get displayed

In an if/else statment, when I have the “if” body toast is displayed for empty EditText BUT when I add the else body, it does not get displayed solved In an if/else statment, when I have the “if” body toast is displayed for empty EditText BUT when I add the else body, it does not … Read more

[Solved] java.lang.RuntimeException: Unable to instantiate activity ComponentInfo in android camera app

Caused by: java.lang.NullPointerException at android.app.Activity.findViewById(Activity.java:1794) at firstapp.boysjoys.com.waste.MainActivity.<init>(MainActivity.java:102) You’re calling findViewById() too early, in activity <init> phase that includes e.g. member variable initialization. You can only call activity methods like findViewById() in onCreate() or later in the activity lifecycle. Move the findViewById() call to onCreate() to get rid of the NPE. Put it after setContentView() so … Read more

[Solved] How to pass a variable from an activity to a class?

You can just instantiate your database class in your activity OpenHelper mOpenHelper = new OpenHelper(this); And create a method in your db class to create your tables public void createTable(String nomelistafinal ) { final SQLiteDatabase db = getWritableDatabase(); db.execSQL(“CREATE TABLE ” + nomelistafinal + ” (codigo text not null) “); db.close(); } 0 solved How … Read more

[Solved] Error on start activity (NullPointerException) on Android Development

Line 46 is; actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); The only thing that can be null on here is actionBar, therefore getActionBar() is returning null, the reasons for this; getActionBar() returns null – Title bar isn’t visible. getActionBar returns null – You must request an action bar using getWindow().requestFeature(Window.FEATURE_ACTION_BAR);, you may think your info bar is an action bar. etc. … Read more

[Solved] Android – Confuse on put source code [closed]

Try this code, I only change the position after part end of z as first and second reachable statement in on create function. @Override protected void onCreate(Bundle savedInstanceState) { //END OF PART Z super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //PART Z String consumerKey = “YII”; String consumerSecret = “YII”; String accessToken = “YII”; String accessTokenSecret = “YII”; //Instantiate a … Read more