Posts

Showing posts with the label android-studio

How to utilise seperate ConstraintSet actions for different TextViews in the same ConstraintLayout?

How to utilise seperate ConstraintSet actions for different TextViews in the same ConstraintLayout? My question follows on from this question: Android : How to programatically set layout_constraintRight_toRightOf "parent". I have the written the following code that should constrain the new TextView to either the left (btnSendL) or the right (btnSendR) of a ConstraintLayout. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ConstraintLayout clMessagesContainer = (ConstraintLayout) findViewById(R.id.clMessagesContainer); final EditText txtMessage = (EditText) findViewById(R.id.txtMessage); Button btnSendL = (Button) findViewById(R.id.btnSendL); Button btnSendR = (Button) findViewById(R.id.btnSendR); btnSendL.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { TextView lblNxtMessage =...

Adding Android Studio Project to new git Repository

Adding Android Studio Project to new git Repository I create a new repository from bitbucket and create new android project want to add in a new repository but whenever I do the old android bitbucket project added to new repository along with the new Android project, I want only one project with one repository, I tried all nothing is working, I have also changed url from git bash but whenever I add, commit and push project from android studio, it also show old project hierarchy in push window and it pushes to new repository. I don't want to add old project with new repository. I tried many command rehead,rebash etc etc..any help will be appreciated What is the directory structure of your two projects? I mean, are both projects in the same directory? Does that parent directory have a .git directory? (Be sure to "show hidden files" in order to check.) – Code-Apprentice Jun 29 at 18:11 ...

Sync is OK but unable to run the project

Image
Sync is OK but unable to run the project Although syncing the android project has no error, When I want to run it, the "edit configuration" dialog opens and says please select android sdk. I expected that such settings should be done in the sync process. Isn't that? 1 Answer 1 You can resolve this issue by doing this File -> Sync Project with Gradle Files I did that. Still see thee same window – mahmood Jun 28 at 13:18 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

android studio :Attempt to invoke virtual method on a null object reference

android studio :Attempt to invoke virtual method on a null object reference can someone help me? whenever i click on the dialoginterface.onclicklistener button the app just crashes can anyone check for me my codes . ALso when i want the same dialoginterface button to retrieve the inserted data from database to be viewed as a list view ill provide with database and page codes public class mainscreen extends AppCompatActivity { private static final String TAG = "ListDataActivity"; ImageButton add; DatabaseHelper db; private ListView listView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mainscreen); listView = (ListView)findViewById(R.id.listview); add = (ImageButton) findViewById(R.id.addbtn); //populateListView(); add.setOnClickListener(new View.OnClickListener() { @Override public void onClick...

Android Studio latest version could not find method compile for arguments directory libs

Android Studio latest version could not find method compile for arguments directory libs I have pasted my build.gradle codes in this question, please suggest what to do. Error message: Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Configuration: apply plugin: 'com.android.application' ext { supportVersion='27.1.1' } android { compileSdkVersion 28 defaultConfig { applicationId "com.eassycars.www.dlservices" minSdkVersion 17 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } buildscript { ...

Android Studio is changed automatically

Android Studio is changed automatically I am so glad that you read this issue that I faced. So I was working on an application, and when I wanted to add the GDPR code, the android studio restarted itself and I can't rebuild my project even if I click on the rebuilt bottom. And also the preview of android studio is changed enters the image description here By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Show a Fragment in FrameLayout without element in layout editor?

Show a Fragment in FrameLayout without <fragment> element in layout editor? I know that tools:layout can be used to show a fragment in <fragment> elements in the Android Studio's layout editor . tools:layout <fragment> However, I want to add a fragment in a FrameLayout at runtime (so that I can change the fragment). Similar questions found in SO like Question 1 and Question 2, but the answers in the pages cannot solve the problem exactly. What I want to do is: <fragment> <include> tools:layout <fragment> View.isInEditMode By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How to add fitur update on android studio with SQLite [on hold]

How to add fitur update on android studio with SQLite [on hold] I have a link tutorial to block incoming call android studio, Ok, this link http://www.androidbegin.com/tutorial/automatic-call-blocking-using-android-telephony-tutorial/ But, in this tutorial have not fitur update. Anyone can helpme to add simple update? sorry i'am not include sourcode in this question. I think to easy look sourcode in link tutorial, http://www.androidbegin.com/tutorial/automatic-call-blocking-using-android-telephony-tutorial/ - Thanks Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Adding looping within VideoView

Adding looping within VideoView I'm having a bit of trouble with a small application I've put together in Android Studio. Essentially the application is suppose to launch - autoplay a video and keep looping until touched... I've got everything bar the looping working - I've tried a few suggestions from here but none have worked in my case (or not had the coding skills to get them to...) Main code below package com.pixel.danny.screensaverhfx; import android.app.Activity; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.VideoView; public class MainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); VideoView videoView = findViewById(R.id.videoView); Uri uri=Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.hab); vid...

changes made in styles.xml are not reflecting in my android studio project

changes made in styles.xml are not reflecting in my android studio project <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Primary theme color of the app (sets background color of app bar) --> <item name="colorPrimary">#FF9800</item> <!-- Primary dark theme color of the app (sets color of status bar) --> <item name="colorPrimaryDark">#FB8C00</item> <!-- Background color of buttons in the app --> <item name="colorButtonNormal">#FF9800</item> </style> </resources> I tried to Invalidate cashes/restart, syncing with gradle again, clean build but, even checked androidMenifest.xml file. Everything looks fine, but i am still not able to use styles.xml to change style of my app. someone please suggest what should i do? ...